glib2 1.1.4-x86-mingw32 → 1.1.5-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +17 -3
- data/ext/glib2/rbglib.h +1 -1
- data/lib/1.8/glib2.so +0 -0
- data/lib/1.9/glib2.so +0 -0
- data/lib/gnome2-raketask.rb +32 -28
- data/lib/gnome2-win32-binary-build-task.rb +191 -0
- data/lib/{gnome2-win32-binary-downloader.rb → gnome2-win32-binary-download-task.rb} +62 -19
- data/vendor/local/bin/asn1Coding.exe +0 -0
- data/vendor/local/bin/asn1Decoding.exe +0 -0
- data/vendor/local/bin/asn1Parser.exe +0 -0
- data/vendor/local/bin/certtool.exe +0 -0
- data/vendor/local/bin/dumpsexp.exe +0 -0
- data/vendor/local/bin/gnutls-cli-debug.exe +0 -0
- data/vendor/local/bin/gnutls-cli.exe +0 -0
- data/vendor/local/bin/gnutls-serv.exe +0 -0
- data/vendor/local/bin/gpg-error.exe +0 -0
- data/vendor/local/bin/hmac256.exe +0 -0
- data/vendor/local/bin/libgcrypt-11.dll +0 -0
- data/vendor/local/bin/libgcrypt-config +177 -0
- data/vendor/local/bin/libgnutls-26.dll +0 -0
- data/vendor/local/bin/libgnutls-extra-26.dll +0 -0
- data/vendor/local/bin/libgnutls-openssl-26.dll +0 -0
- data/vendor/local/bin/libgpg-error-0.dll +0 -0
- data/vendor/local/bin/libtasn1-3.dll +0 -0
- data/vendor/local/bin/psktool.exe +0 -0
- data/vendor/local/bin/srptool.exe +0 -0
- data/vendor/local/gnutls.README.txt +6 -0
- data/vendor/local/include/gcrypt-module.h +226 -0
- data/vendor/local/include/gcrypt.h +1826 -0
- data/vendor/local/include/gnutls/compat.h +105 -0
- data/vendor/local/include/gnutls/crypto.h +73 -0
- data/vendor/local/include/gnutls/extra.h +137 -0
- data/vendor/local/include/gnutls/gnutls.h +1333 -0
- data/vendor/local/include/gnutls/gnutlsxx.h +388 -0
- data/vendor/local/include/gnutls/openpgp.h +283 -0
- data/vendor/local/include/gnutls/openssl.h +335 -0
- data/vendor/local/include/gnutls/pkcs12.h +106 -0
- data/vendor/local/include/gnutls/x509.h +672 -0
- data/vendor/local/include/gpg-error.h +651 -0
- data/vendor/local/include/libtasn1.h +246 -0
- data/vendor/local/lib/gio/modules/libgiognutls.a +0 -0
- data/vendor/local/lib/gio/modules/libgiognutls.dll +0 -0
- data/vendor/local/lib/gio/modules/libgiognutls.dll.a +0 -0
- data/vendor/local/lib/gio/modules/libgiognutls.la +41 -0
- data/vendor/local/lib/libgcrypt.def +237 -0
- data/vendor/local/lib/libgcrypt.dll.a +0 -0
- data/vendor/local/lib/libgnutls-extra.dll.a +0 -0
- data/vendor/local/lib/libgnutls-openssl.dll.a +0 -0
- data/vendor/local/lib/libgnutls.dll.a +0 -0
- data/vendor/local/lib/libgnutlsxx.dll.a +0 -0
- data/vendor/local/lib/libgpg-error.dll.a +0 -0
- data/vendor/local/lib/libtasn1.dll.a +0 -0
- data/vendor/local/lib/pkgconfig/gnutls.pc +23 -0
- data/vendor/local/manifest/gnutls-dev_2.4.2-1_win32.mft +593 -0
- data/vendor/local/manifest/gnutls_2.4.2-1_win32.mft +8 -0
- data/vendor/local/share/aclocal/gpg-error.m4 +65 -0
- data/vendor/local/share/aclocal/libgcrypt.m4 +108 -0
- data/vendor/local/share/aclocal/libgnutls-extra.m4 +161 -0
- data/vendor/local/share/aclocal/libgnutls.m4 +160 -0
- data/vendor/local/share/aclocal/libtasn1.m4 +160 -0
- data/vendor/local/share/common-lisp/source/gpg-error/gpg-error-codes.lisp +417 -0
- data/vendor/local/share/common-lisp/source/gpg-error/gpg-error-package.lisp +64 -0
- data/vendor/local/share/common-lisp/source/gpg-error/gpg-error.asd +36 -0
- data/vendor/local/share/common-lisp/source/gpg-error/gpg-error.lisp +236 -0
- data/vendor/local/share/info/gcrypt.info +6243 -0
- data/vendor/local/share/info/gnutls-certificate-user-use-case.png +0 -0
- data/vendor/local/share/info/gnutls-client-server-use-case.png +0 -0
- data/vendor/local/share/info/gnutls-extensions_st.png +0 -0
- data/vendor/local/share/info/gnutls-handshake-sequence.png +0 -0
- data/vendor/local/share/info/gnutls-handshake-state.png +0 -0
- data/vendor/local/share/info/gnutls-internals.png +0 -0
- data/vendor/local/share/info/gnutls-layers.png +0 -0
- data/vendor/local/share/info/gnutls-logo.png +0 -0
- data/vendor/local/share/info/gnutls-mod_auth_st.png +0 -0
- data/vendor/local/share/info/gnutls-objects.png +0 -0
- data/vendor/local/share/info/gnutls-pgp.png +0 -0
- data/vendor/local/share/info/gnutls-x509.png +0 -0
- data/vendor/local/share/info/gnutls.info +708 -0
- data/vendor/local/share/info/gnutls.info-1 +10467 -0
- data/vendor/local/share/info/gnutls.info-2 +7896 -0
- data/vendor/local/share/info/gnutls.info-3 +1899 -0
- data/vendor/local/share/info/libtasn1.info +2993 -0
- data/vendor/local/share/license/glib-networking/AUTHORS +0 -0
- data/vendor/local/share/license/glib-networking/COPYING +482 -0
- data/vendor/local/share/locale/as/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/bg/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/bn_IN/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/ca/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/cs/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/da/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/de/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/el/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/en_CA/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/en_GB/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/eo/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/es/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/et/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/eu/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/fr/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/gl/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/gu/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/he/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/hi/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/hu/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/id/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/it/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/ja/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/kn/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/ko/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/lv/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/mr/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/nb/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/nl/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/or/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/pa/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/pl/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/pt/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/pt_BR/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/ro/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/ru/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/sl/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/sr/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/sr@latin/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/sv/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/tr/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/ug/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/uk/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/vi/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/zh_CN/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/zh_HK/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/locale/zh_TW/LC_MESSAGES/glib-networking.mo +0 -0
- data/vendor/local/share/man/man1/asn1Coding.1 +46 -0
- data/vendor/local/share/man/man1/asn1Decoding.1 +41 -0
- data/vendor/local/share/man/man1/asn1Parser.1 +49 -0
- data/vendor/local/share/man/man1/certtool.1 +159 -0
- data/vendor/local/share/man/man1/gnutls-cli-debug.1 +31 -0
- data/vendor/local/share/man/man1/gnutls-cli.1 +166 -0
- data/vendor/local/share/man/man1/gnutls-serv.1 +134 -0
- data/vendor/local/share/man/man1/psktool.1 +31 -0
- data/vendor/local/share/man/man1/srptool.1 +73 -0
- data/vendor/local/share/man/man3/asn1_array2tree.3 +47 -0
- data/vendor/local/share/man/man3/asn1_bit_der.3 +39 -0
- data/vendor/local/share/man/man3/asn1_check_version.3 +39 -0
- data/vendor/local/share/man/man3/asn1_copy_node.3 +39 -0
- data/vendor/local/share/man/man3/asn1_create_element.3 +45 -0
- data/vendor/local/share/man/man3/asn1_delete_element.3 +39 -0
- data/vendor/local/share/man/man3/asn1_delete_structure.3 +37 -0
- data/vendor/local/share/man/man3/asn1_der_coding.3 +52 -0
- data/vendor/local/share/man/man3/asn1_der_decoding.3 +50 -0
- data/vendor/local/share/man/man3/asn1_der_decoding_element.3 +54 -0
- data/vendor/local/share/man/man3/asn1_der_decoding_startEnd.3 +58 -0
- data/vendor/local/share/man/man3/asn1_expand_any_defined_by.3 +45 -0
- data/vendor/local/share/man/man3/asn1_expand_octet_string.3 +51 -0
- data/vendor/local/share/man/man3/asn1_find_node.3 +38 -0
- data/vendor/local/share/man/man3/asn1_find_structure_from_oid.3 +37 -0
- data/vendor/local/share/man/man3/asn1_get_bit_der.3 +43 -0
- data/vendor/local/share/man/man3/asn1_get_length_der.3 +38 -0
- data/vendor/local/share/man/man3/asn1_get_octet_der.3 +43 -0
- data/vendor/local/share/man/man3/asn1_get_tag_der.3 +41 -0
- data/vendor/local/share/man/man3/asn1_length_der.3 +36 -0
- data/vendor/local/share/man/man3/asn1_number_of_elements.3 +43 -0
- data/vendor/local/share/man/man3/asn1_octet_der.3 +37 -0
- data/vendor/local/share/man/man3/asn1_parser2array.3 +58 -0
- data/vendor/local/share/man/man3/asn1_parser2tree.3 +55 -0
- data/vendor/local/share/man/man3/asn1_print_structure.3 +40 -0
- data/vendor/local/share/man/man3/asn1_read_tag.3 +46 -0
- data/vendor/local/share/man/man3/asn1_read_value.3 +92 -0
- data/vendor/local/share/man/man3/asn1_write_value.3 +136 -0
- data/vendor/local/share/man/man3/gnutls_alert_get.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_alert_get_name.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_alert_send.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_alert_send_appropriate.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_anon_allocate_client_credentials.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_anon_allocate_server_credentials.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_anon_free_client_credentials.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_anon_free_server_credentials.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_anon_set_params_function.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_anon_set_server_dh_params.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_anon_set_server_params_function.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_auth_client_get_type.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_auth_get_type.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_auth_server_get_type.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_bye.3 +61 -0
- data/vendor/local/share/man/man3/gnutls_certificate_activation_time_peers.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_certificate_allocate_credentials.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_certificate_client_get_request_status.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_certificate_client_set_retrieve_function.3 +58 -0
- data/vendor/local/share/man/man3/gnutls_certificate_expiration_time_peers.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_certificate_free_ca_names.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_certificate_free_cas.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_certificate_free_credentials.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_certificate_free_crls.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_certificate_free_keys.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_certificate_get_openpgp_keyring.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_certificate_get_ours.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_certificate_get_peers.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_certificate_get_x509_cas.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_certificate_get_x509_crls.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_certificate_send_x509_rdn_sequence.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_certificate_server_set_request.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_certificate_server_set_retrieve_function.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_dh_params.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_openpgp_key.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_openpgp_key_file.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_openpgp_key_file2.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_openpgp_key_mem.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_openpgp_key_mem2.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_openpgp_keyring_file.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_openpgp_keyring_mem.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_params_function.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_rsa_export_params.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_verify_flags.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_verify_limits.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_crl.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_crl_file.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_crl_mem.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_key.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_key_file.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_key_mem.3 +60 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_simple_pkcs12_file.3 +62 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_trust.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_trust_file.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_certificate_set_x509_trust_mem.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_certificate_type_get.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_certificate_type_get_id.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_certificate_type_get_name.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_certificate_type_list.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_certificate_type_set_priority.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_certificate_verify_peers.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_certificate_verify_peers2.3 +54 -0
- data/vendor/local/share/man/man3/gnutls_check_version.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_cipher_get.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_cipher_get_id.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_cipher_get_key_size.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_cipher_get_name.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_cipher_list.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_cipher_set_priority.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_cipher_suite_get_name.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_cipher_suite_info.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_compression_get.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_compression_get_id.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_compression_get_name.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_compression_list.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_compression_set_priority.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_credentials_clear.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_credentials_set.3 +53 -0
- data/vendor/local/share/man/man3/gnutls_crypto_cipher_register.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_crypto_digest_register.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_crypto_mac_register.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_crypto_rnd_register.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_db_check_entry.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_db_get_ptr.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_db_remove_session.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_db_set_cache_expiration.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_db_set_ptr.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_db_set_remove_function.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_db_set_retrieve_function.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_db_set_store_function.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_deinit.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_dh_get_group.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_dh_get_peers_public_bits.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_dh_get_prime_bits.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_dh_get_pubkey.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_dh_get_secret_bits.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_dh_params_cpy.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_dh_params_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_dh_params_export_pkcs3.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_dh_params_export_raw.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_dh_params_generate2.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_dh_params_import_pkcs3.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_dh_params_import_raw.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_dh_params_init.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_dh_set_prime_bits.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_error_is_fatal.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_error_to_alert.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_extra_check_version.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_fingerprint.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_free.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_global_deinit.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_global_init.3 +60 -0
- data/vendor/local/share/man/man3/gnutls_global_init_extra.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_global_set_log_function.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_global_set_log_level.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_global_set_mem_functions.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_handshake.3 +53 -0
- data/vendor/local/share/man/man3/gnutls_handshake_get_last_in.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_handshake_get_last_out.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_handshake_set_max_packet_length.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_handshake_set_post_client_hello_function.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_handshake_set_private_extensions.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_hex2bin.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_hex_decode.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_hex_encode.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_ia_allocate_client_credentials.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_ia_allocate_server_credentials.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_ia_enable.3 +53 -0
- data/vendor/local/share/man/man3/gnutls_ia_endphase_send.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_ia_extract_inner_secret.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_ia_free_client_credentials.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_ia_free_server_credentials.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_ia_generate_challenge.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_ia_get_client_avp_ptr.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_ia_get_server_avp_ptr.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_ia_handshake.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_ia_handshake_p.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_ia_permute_inner_secret.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_ia_recv.3 +57 -0
- data/vendor/local/share/man/man3/gnutls_ia_send.3 +56 -0
- data/vendor/local/share/man/man3/gnutls_ia_set_client_avp_function.3 +61 -0
- data/vendor/local/share/man/man3/gnutls_ia_set_client_avp_ptr.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_ia_set_server_avp_function.3 +68 -0
- data/vendor/local/share/man/man3/gnutls_ia_set_server_avp_ptr.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_ia_verify_endphase.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_init.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_kx_get.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_kx_get_id.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_kx_get_name.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_kx_list.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_kx_set_priority.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_mac_get.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_mac_get_id.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_mac_get_key_size.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_mac_get_name.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_mac_list.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_mac_set_priority.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_malloc.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_check_hostname.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_export.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_auth_subkey.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_creation_time.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_expiration_time.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_fingerprint.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_key_id.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_key_usage.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_name.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_pk_algorithm.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_pk_dsa_raw.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_pk_rsa_raw.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_preferred_key_id.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_revoked_status.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_count.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_creation_time.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_expiration_time.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_fingerprint.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_id.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_idx.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_pk_algorithm.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_pk_dsa_raw.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_pk_rsa_raw.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_revoked_status.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_subkey_usage.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_get_version.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_import.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_init.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_print.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_set_preferred_key_id.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_verify_ring.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_crt_verify_self.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_keyring_check_id.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_keyring_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_keyring_get_crt.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_keyring_get_crt_count.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_keyring_import.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_keyring_init.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_export.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_export_dsa_raw.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_export_rsa_raw.3 +51 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_export_subkey_dsa_raw.3 +51 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_export_subkey_rsa_raw.3 +53 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_fingerprint.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_key_id.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_pk_algorithm.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_preferred_key_id.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_revoked_status.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_subkey_count.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_subkey_creation_time.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_subkey_expiration_time.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_subkey_fingerprint.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_subkey_id.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_subkey_idx.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_subkey_pk_algorithm.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_get_subkey_revoked_status.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_import.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_init.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_set_preferred_key_id.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_privkey_sign_hash.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_send_cert.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_openpgp_set_recv_key_function.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_oprfi_enable_client.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_oprfi_enable_server.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_pem_base64_decode.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_pem_base64_decode_alloc.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_pem_base64_encode.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_pem_base64_encode_alloc.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_perror.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_pk_algorithm_get_name.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_decrypt.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_encrypt.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_get_count.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_get_data.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_get_friendly_name.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_get_key_id.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_get_type.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_init.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_set_crl.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_set_crt.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_set_data.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_set_friendly_name.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_bag_set_key_id.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_export.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_generate_mac.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_get_bag.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_import.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_init.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_set_bag.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs12_verify_mac.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_delete_crl.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_delete_crt.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_export.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_get_crl_count.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_get_crl_raw.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_get_crt_count.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_get_crt_raw.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_import.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_init.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_set_crl.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_set_crl_raw.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_set_crt.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_pkcs7_set_crt_raw.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_prf.3 +63 -0
- data/vendor/local/share/man/man3/gnutls_prf_raw.3 +62 -0
- data/vendor/local/share/man/man3/gnutls_priority_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_priority_init.3 +99 -0
- data/vendor/local/share/man/man3/gnutls_priority_set.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_priority_set_direct.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_protocol_get_id.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_protocol_get_name.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_protocol_get_version.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_protocol_list.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_protocol_set_priority.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_psk_allocate_client_credentials.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_psk_allocate_server_credentials.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_psk_client_get_hint.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_psk_free_client_credentials.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_psk_free_server_credentials.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_psk_netconf_derive_key.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_psk_server_get_username.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_psk_set_client_credentials.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_psk_set_client_credentials_function.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_psk_set_params_function.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_psk_set_server_credentials_file.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_psk_set_server_credentials_function.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_psk_set_server_credentials_hint.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_psk_set_server_dh_params.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_psk_set_server_params_function.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_record_check_pending.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_record_disable_padding.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_record_get_direction.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_record_get_max_size.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_record_recv.3 +59 -0
- data/vendor/local/share/man/man3/gnutls_record_send.3 +57 -0
- data/vendor/local/share/man/man3/gnutls_record_set_max_size.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_rehandshake.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_rsa_export_get_modulus_bits.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_rsa_export_get_pubkey.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_rsa_params_cpy.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_rsa_params_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_rsa_params_export_pkcs1.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_rsa_params_export_raw.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_rsa_params_generate2.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_rsa_params_import_pkcs1.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_rsa_params_import_raw.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_rsa_params_init.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_server_name_get.3 +53 -0
- data/vendor/local/share/man/man3/gnutls_server_name_set.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_session_enable_compatibility_mode.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_session_get_client_random.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_session_get_data.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_session_get_data2.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_session_get_id.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_session_get_master_secret.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_session_get_ptr.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_session_get_server_random.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_session_is_resumed.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_session_set_data.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_session_set_ptr.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_set_default_export_priority.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_set_default_priority.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_sign_algorithm_get_name.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_sign_callback_get.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_sign_callback_set.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_srp_allocate_client_credentials.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_srp_allocate_server_credentials.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_srp_base64_decode.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_srp_base64_decode_alloc.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_srp_base64_encode.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_srp_base64_encode_alloc.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_srp_free_client_credentials.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_srp_free_server_credentials.3 +34 -0
- data/vendor/local/share/man/man3/gnutls_srp_server_get_username.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_srp_set_client_credentials.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_srp_set_client_credentials_function.3 +54 -0
- data/vendor/local/share/man/man3/gnutls_srp_set_server_credentials_file.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_srp_set_server_credentials_function.3 +56 -0
- data/vendor/local/share/man/man3/gnutls_srp_verifier.3 +53 -0
- data/vendor/local/share/man/man3/gnutls_strerror.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_transport_get_ptr.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_transport_get_ptr2.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_transport_set_errno.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_transport_set_global_errno.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_transport_set_lowat.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_transport_set_ptr.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_transport_set_ptr2.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_transport_set_pull_function.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_transport_set_push_function.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_check_issuer.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_export.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_crt_count.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_crt_serial.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_dn_oid.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_issuer_dn.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_issuer_dn_by_oid.3 +58 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_next_update.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_signature.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_signature_algorithm.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_this_update.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_get_version.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_import.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_init.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_print.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_set_crt.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_set_crt_serial.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_set_next_update.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_set_this_update.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_set_version.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_sign.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_sign2.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_x509_crl_verify.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_export.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_get_attribute_by_oid.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_get_challenge_password.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_get_dn.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_get_dn_by_oid.3 +59 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_get_dn_oid.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_get_pk_algorithm.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_get_version.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_import.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_init.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_set_attribute_by_oid.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_set_challenge_password.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_set_dn_by_oid.3 +51 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_set_key.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_set_version.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_sign.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_x509_crq_sign2.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_check_hostname.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_check_issuer.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_check_revocation.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_cpy_crl_dist_points.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_export.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_activation_time.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_authority_key_id.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_basic_constraints.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_ca_status.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_crl_dist_points.3 +66 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_dn.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_dn_by_oid.3 +58 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_dn_oid.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_expiration_time.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_extension_by_oid.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_extension_data.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_extension_info.3 +53 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_extension_oid.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_fingerprint.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_issuer.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_issuer_dn.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_issuer_dn_by_oid.3 +58 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_issuer_dn_oid.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_key_id.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_key_purpose_oid.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_key_usage.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_pk_algorithm.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_pk_dsa_raw.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_pk_rsa_raw.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_proxy.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_raw_dn.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_raw_issuer_dn.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_serial.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_signature.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_signature_algorithm.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_subject.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_subject_alt_name.3 +64 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_subject_alt_name2.3 +49 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_subject_alt_othername_oid.3 +56 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_subject_key_id.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_get_version.3 +35 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_import.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_init.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_list_import.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_list_verify.3 +68 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_print.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_activation_time.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_authority_key_id.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_basic_constraints.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_ca_status.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_crl_dist_points.3 +42 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_crq.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_dn_by_oid.3 +52 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_expiration_time.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_extension_by_oid.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_issuer_dn_by_oid.3 +56 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_key.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_key_purpose_oid.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_key_usage.3 +38 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_proxy.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_proxy_dn.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_serial.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_subject_alternative_name.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_subject_key_id.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_set_version.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_sign.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_sign2.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_verify.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_x509_crt_verify_data.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_dn_deinit.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_x509_dn_export.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_dn_get_rdn_ava.3 +46 -0
- data/vendor/local/share/man/man3/gnutls_x509_dn_import.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_x509_dn_init.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_dn_oid_known.3 +41 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_cpy.3 +39 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_deinit.3 +33 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_export.3 +52 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_export_dsa_raw.3 +47 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_export_pkcs8.3 +61 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_export_rsa_raw.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_fix.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_generate.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_get_key_id.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_get_pk_algorithm.3 +37 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_import.3 +45 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_import_dsa_raw.3 +48 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_import_pkcs8.3 +54 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_import_rsa_raw.3 +50 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_init.3 +36 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_sign_data.3 +54 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_sign_hash.3 +40 -0
- data/vendor/local/share/man/man3/gnutls_x509_privkey_verify_data.3 +43 -0
- data/vendor/local/share/man/man3/gnutls_x509_rdn_get.3 +44 -0
- data/vendor/local/share/man/man3/gnutls_x509_rdn_get_by_oid.3 +51 -0
- data/vendor/local/share/man/man3/gnutls_x509_rdn_get_oid.3 +45 -0
- data/vendor/local/share/man/man3/libtasn1_perror.3 +32 -0
- data/vendor/local/share/man/man3/libtasn1_strerror.3 +35 -0
- metadata +660 -5
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,177 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
|
3
|
+
#
|
4
|
+
# This file is free software; as a special exception the author gives
|
5
|
+
# unlimited permission to copy and/or distribute it, with or without
|
6
|
+
# modifications, as long as this notice is preserved.
|
7
|
+
#
|
8
|
+
# This file is distributed in the hope that it will be useful, but
|
9
|
+
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
10
|
+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
11
|
+
#
|
12
|
+
# File: src/libgcrypt-config. Generated from libgcrypt-config.in by configure.
|
13
|
+
|
14
|
+
# General.
|
15
|
+
prefix="`dirname $0`/.."
|
16
|
+
exec_prefix="${prefix}"
|
17
|
+
version="1.4.2"
|
18
|
+
includedir="${prefix}/include"
|
19
|
+
libdir="${exec_prefix}/lib"
|
20
|
+
gpg_error_libs="-L${prefix}/lib -lgpg-error"
|
21
|
+
gpg_error_cflags="-I${prefix}/include"
|
22
|
+
|
23
|
+
# libgcrypt values.
|
24
|
+
libs="-lgcrypt"
|
25
|
+
cflags=""
|
26
|
+
|
27
|
+
# API info
|
28
|
+
api_version="1"
|
29
|
+
|
30
|
+
# Misc information.
|
31
|
+
symmetric_ciphers="arcfour blowfish cast5 des aes twofish serpent rfc2268 seed camellia"
|
32
|
+
asymmetric_ciphers="dsa elgamal rsa ecc"
|
33
|
+
digests="crc md4 md5 rmd160 sha1 sha256 sha512 tiger whirlpool"
|
34
|
+
|
35
|
+
# State variables.
|
36
|
+
echo_libs=no
|
37
|
+
echo_cflags=no
|
38
|
+
echo_prefix=no
|
39
|
+
echo_algorithms=no
|
40
|
+
echo_exec_prefix=no
|
41
|
+
echo_version=no
|
42
|
+
echo_api_version=no
|
43
|
+
|
44
|
+
# Prints usage information.
|
45
|
+
usage()
|
46
|
+
{
|
47
|
+
cat <<EOF
|
48
|
+
Usage: $0 [OPTIONS]
|
49
|
+
Options:
|
50
|
+
[--prefix]
|
51
|
+
[--exec-prefix]
|
52
|
+
[--version]
|
53
|
+
[--api-version]
|
54
|
+
[--libs]
|
55
|
+
[--cflags]
|
56
|
+
[--algorithms]
|
57
|
+
EOF
|
58
|
+
exit $1
|
59
|
+
}
|
60
|
+
|
61
|
+
if test $# -eq 0; then
|
62
|
+
# Nothing to do.
|
63
|
+
usage 1 1>&2
|
64
|
+
fi
|
65
|
+
|
66
|
+
while test $# -gt 0; do
|
67
|
+
case "$1" in
|
68
|
+
# Set up `optarg'.
|
69
|
+
--*=*)
|
70
|
+
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
|
71
|
+
;;
|
72
|
+
*)
|
73
|
+
optarg=""
|
74
|
+
;;
|
75
|
+
esac
|
76
|
+
|
77
|
+
case $1 in
|
78
|
+
--thread=*)
|
79
|
+
echo "$0: --thread option obsolete: use the thread callback interface" 1>&2
|
80
|
+
exit 1
|
81
|
+
;;
|
82
|
+
--prefix=*)
|
83
|
+
# For compatibility reasons with old M4 macros, we ignore
|
84
|
+
# setting of prefix.
|
85
|
+
;;
|
86
|
+
--prefix)
|
87
|
+
echo_prefix=yes
|
88
|
+
;;
|
89
|
+
--exec-prefix=*)
|
90
|
+
;;
|
91
|
+
--exec-prefix)
|
92
|
+
echo_exec_prefix=yes
|
93
|
+
;;
|
94
|
+
--version)
|
95
|
+
echo_version=yes
|
96
|
+
;;
|
97
|
+
--api-version)
|
98
|
+
echo_api_version=yes
|
99
|
+
;;
|
100
|
+
--cflags)
|
101
|
+
echo_cflags=yes
|
102
|
+
;;
|
103
|
+
--libs)
|
104
|
+
echo_libs=yes
|
105
|
+
;;
|
106
|
+
--algorithms)
|
107
|
+
echo_algorithms=yes
|
108
|
+
;;
|
109
|
+
*)
|
110
|
+
usage 1 1>&2
|
111
|
+
;;
|
112
|
+
esac
|
113
|
+
shift
|
114
|
+
done
|
115
|
+
|
116
|
+
if test "$echo_prefix" = "yes"; then
|
117
|
+
echo "$prefix"
|
118
|
+
fi
|
119
|
+
|
120
|
+
if test "$echo_exec_prefix" = "yes"; then
|
121
|
+
echo "$exec_prefix"
|
122
|
+
fi
|
123
|
+
|
124
|
+
if test "$echo_cflags" = "yes"; then
|
125
|
+
includes=""
|
126
|
+
cflags_final="$cflags"
|
127
|
+
|
128
|
+
# Set up `includes'.
|
129
|
+
if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then
|
130
|
+
includes="-I$includedir"
|
131
|
+
fi
|
132
|
+
# Set up `cflags_final'.
|
133
|
+
cflags_final="$cflags_final $gpg_error_cflags"
|
134
|
+
|
135
|
+
tmp=""
|
136
|
+
for i in $includes $cflags_final; do
|
137
|
+
if echo "$tmp" | fgrep -v -- "$i" >/dev/null; then
|
138
|
+
tmp="$tmp $i"
|
139
|
+
fi
|
140
|
+
done
|
141
|
+
echo $tmp
|
142
|
+
fi
|
143
|
+
|
144
|
+
if test "$echo_libs" = "yes"; then
|
145
|
+
libdirs=""
|
146
|
+
libs_final="$libs"
|
147
|
+
|
148
|
+
# Set up `libdirs'.
|
149
|
+
if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/lib"; then
|
150
|
+
libdirs="-L$libdir"
|
151
|
+
fi
|
152
|
+
|
153
|
+
# Set up `libs_final'.
|
154
|
+
libs_final="$libs_final $gpg_error_libs"
|
155
|
+
|
156
|
+
tmp=""
|
157
|
+
for i in $libdirs $libs_final; do
|
158
|
+
if echo "$tmp" | fgrep -v -- "$i" >/dev/null; then
|
159
|
+
tmp="$tmp $i"
|
160
|
+
fi
|
161
|
+
done
|
162
|
+
echo $tmp
|
163
|
+
fi
|
164
|
+
|
165
|
+
if test "$echo_version" = "yes"; then
|
166
|
+
echo "$version"
|
167
|
+
fi
|
168
|
+
|
169
|
+
if test "$echo_api_version" = "yes"; then
|
170
|
+
echo "$api_version"
|
171
|
+
fi
|
172
|
+
|
173
|
+
if test "$echo_algorithms" = "yes"; then
|
174
|
+
echo "Symmetric cipher algorithms: $symmetric_ciphers"
|
175
|
+
echo "Public-key cipher algorithms: $asymmetric_ciphers"
|
176
|
+
echo "Message digest algorithms: $digests"
|
177
|
+
fi
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,226 @@
|
|
1
|
+
/* gcrypt-module.h - GNU Cryptographic Library Interface
|
2
|
+
Copyright (C) 2003, 2007 Free Software Foundation, Inc.
|
3
|
+
|
4
|
+
This file is part of Libgcrypt.
|
5
|
+
|
6
|
+
Libgcrypt is free software; you can redistribute it and/or modify
|
7
|
+
it under the terms of the GNU Lesser General Public License as
|
8
|
+
published by the Free Software Foundation; either version 2.1 of
|
9
|
+
the License, or (at your option) any later version.
|
10
|
+
|
11
|
+
Libgcrypt is distributed in the hope that it will be useful,
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
GNU Lesser General Public License for more details.
|
15
|
+
|
16
|
+
You should have received a copy of the GNU Lesser General Public
|
17
|
+
License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
18
|
+
*/
|
19
|
+
|
20
|
+
/*
|
21
|
+
This file contains the necessary declarations/definitions for
|
22
|
+
working with Libgcrypt modules.
|
23
|
+
*/
|
24
|
+
|
25
|
+
#ifndef _GCRYPT_MODULE_H
|
26
|
+
#define _GCRYPT_MODULE_H
|
27
|
+
|
28
|
+
#ifdef __cplusplus
|
29
|
+
extern "C" {
|
30
|
+
#if 0 /* keep Emacsens's auto-indent happy */
|
31
|
+
}
|
32
|
+
#endif
|
33
|
+
#endif
|
34
|
+
|
35
|
+
/* This type represents a `module'. */
|
36
|
+
typedef struct gcry_module *gcry_module_t;
|
37
|
+
|
38
|
+
/* Check that the library fulfills the version requirement. */
|
39
|
+
|
40
|
+
/* Type for the cipher_setkey function. */
|
41
|
+
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
|
42
|
+
const unsigned char *key,
|
43
|
+
unsigned keylen);
|
44
|
+
|
45
|
+
/* Type for the cipher_encrypt function. */
|
46
|
+
typedef void (*gcry_cipher_encrypt_t) (void *c,
|
47
|
+
unsigned char *outbuf,
|
48
|
+
const unsigned char *inbuf);
|
49
|
+
|
50
|
+
/* Type for the cipher_decrypt function. */
|
51
|
+
typedef void (*gcry_cipher_decrypt_t) (void *c,
|
52
|
+
unsigned char *outbuf,
|
53
|
+
const unsigned char *inbuf);
|
54
|
+
|
55
|
+
/* Type for the cipher_stencrypt function. */
|
56
|
+
typedef void (*gcry_cipher_stencrypt_t) (void *c,
|
57
|
+
unsigned char *outbuf,
|
58
|
+
const unsigned char *inbuf,
|
59
|
+
unsigned int n);
|
60
|
+
|
61
|
+
/* Type for the cipher_stdecrypt function. */
|
62
|
+
typedef void (*gcry_cipher_stdecrypt_t) (void *c,
|
63
|
+
unsigned char *outbuf,
|
64
|
+
const unsigned char *inbuf,
|
65
|
+
unsigned int n);
|
66
|
+
|
67
|
+
typedef struct gcry_cipher_oid_spec
|
68
|
+
{
|
69
|
+
const char *oid;
|
70
|
+
int mode;
|
71
|
+
} gcry_cipher_oid_spec_t;
|
72
|
+
|
73
|
+
/* Module specification structure for ciphers. */
|
74
|
+
typedef struct gcry_cipher_spec
|
75
|
+
{
|
76
|
+
const char *name;
|
77
|
+
const char **aliases;
|
78
|
+
gcry_cipher_oid_spec_t *oids;
|
79
|
+
size_t blocksize;
|
80
|
+
size_t keylen;
|
81
|
+
size_t contextsize;
|
82
|
+
gcry_cipher_setkey_t setkey;
|
83
|
+
gcry_cipher_encrypt_t encrypt;
|
84
|
+
gcry_cipher_decrypt_t decrypt;
|
85
|
+
gcry_cipher_stencrypt_t stencrypt;
|
86
|
+
gcry_cipher_stdecrypt_t stdecrypt;
|
87
|
+
} gcry_cipher_spec_t;
|
88
|
+
|
89
|
+
/* Register a new cipher module whose specification can be found in
|
90
|
+
CIPHER. On success, a new algorithm ID is stored in ALGORITHM_ID
|
91
|
+
and a pointer representing this module is stored in MODULE. */
|
92
|
+
gcry_error_t gcry_cipher_register (gcry_cipher_spec_t *cipher,
|
93
|
+
int *algorithm_id,
|
94
|
+
gcry_module_t *module);
|
95
|
+
|
96
|
+
/* Unregister the cipher identified by MODULE, which must have been
|
97
|
+
registered with gcry_cipher_register. */
|
98
|
+
void gcry_cipher_unregister (gcry_module_t module);
|
99
|
+
|
100
|
+
/* ********************** */
|
101
|
+
|
102
|
+
/* Type for the pk_generate function. */
|
103
|
+
typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
|
104
|
+
unsigned int nbits,
|
105
|
+
unsigned long use_e,
|
106
|
+
gcry_mpi_t *skey,
|
107
|
+
gcry_mpi_t **retfactors);
|
108
|
+
|
109
|
+
/* Type for the pk_check_secret_key function. */
|
110
|
+
typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
|
111
|
+
gcry_mpi_t *skey);
|
112
|
+
|
113
|
+
/* Type for the pk_encrypt function. */
|
114
|
+
typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
|
115
|
+
gcry_mpi_t *resarr,
|
116
|
+
gcry_mpi_t data,
|
117
|
+
gcry_mpi_t *pkey,
|
118
|
+
int flags);
|
119
|
+
|
120
|
+
/* Type for the pk_decrypt function. */
|
121
|
+
typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
|
122
|
+
gcry_mpi_t *result,
|
123
|
+
gcry_mpi_t *data,
|
124
|
+
gcry_mpi_t *skey,
|
125
|
+
int flags);
|
126
|
+
|
127
|
+
/* Type for the pk_sign function. */
|
128
|
+
typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
|
129
|
+
gcry_mpi_t *resarr,
|
130
|
+
gcry_mpi_t data,
|
131
|
+
gcry_mpi_t *skey);
|
132
|
+
|
133
|
+
/* Type for the pk_verify function. */
|
134
|
+
typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
|
135
|
+
gcry_mpi_t hash,
|
136
|
+
gcry_mpi_t *data,
|
137
|
+
gcry_mpi_t *pkey,
|
138
|
+
int (*cmp) (void *, gcry_mpi_t),
|
139
|
+
void *opaquev);
|
140
|
+
|
141
|
+
/* Type for the pk_get_nbits function. */
|
142
|
+
typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);
|
143
|
+
|
144
|
+
/* Module specification structure for message digests. */
|
145
|
+
typedef struct gcry_pk_spec
|
146
|
+
{
|
147
|
+
const char *name;
|
148
|
+
const char **aliases;
|
149
|
+
const char *elements_pkey;
|
150
|
+
const char *elements_skey;
|
151
|
+
const char *elements_enc;
|
152
|
+
const char *elements_sig;
|
153
|
+
const char *elements_grip;
|
154
|
+
int use;
|
155
|
+
gcry_pk_generate_t generate;
|
156
|
+
gcry_pk_check_secret_key_t check_secret_key;
|
157
|
+
gcry_pk_encrypt_t encrypt;
|
158
|
+
gcry_pk_decrypt_t decrypt;
|
159
|
+
gcry_pk_sign_t sign;
|
160
|
+
gcry_pk_verify_t verify;
|
161
|
+
gcry_pk_get_nbits_t get_nbits;
|
162
|
+
} gcry_pk_spec_t;
|
163
|
+
|
164
|
+
/* Register a new pubkey module whose specification can be found in
|
165
|
+
PUBKEY. On success, a new algorithm ID is stored in ALGORITHM_ID
|
166
|
+
and a pointer representhing this module is stored in MODULE. */
|
167
|
+
gcry_error_t gcry_pk_register (gcry_pk_spec_t *pubkey,
|
168
|
+
unsigned int *algorithm_id,
|
169
|
+
gcry_module_t *module);
|
170
|
+
|
171
|
+
/* Unregister the pubkey identified by ID, which must have been
|
172
|
+
registered with gcry_pk_register. */
|
173
|
+
void gcry_pk_unregister (gcry_module_t module);
|
174
|
+
|
175
|
+
/* ********************** */
|
176
|
+
|
177
|
+
/* Type for the md_init function. */
|
178
|
+
typedef void (*gcry_md_init_t) (void *c);
|
179
|
+
|
180
|
+
/* Type for the md_write function. */
|
181
|
+
typedef void (*gcry_md_write_t) (void *c, const void *buf, size_t nbytes);
|
182
|
+
|
183
|
+
/* Type for the md_final function. */
|
184
|
+
typedef void (*gcry_md_final_t) (void *c);
|
185
|
+
|
186
|
+
/* Type for the md_read function. */
|
187
|
+
typedef unsigned char *(*gcry_md_read_t) (void *c);
|
188
|
+
|
189
|
+
typedef struct gcry_md_oid_spec
|
190
|
+
{
|
191
|
+
const char *oidstring;
|
192
|
+
} gcry_md_oid_spec_t;
|
193
|
+
|
194
|
+
/* Module specification structure for message digests. */
|
195
|
+
typedef struct gcry_md_spec
|
196
|
+
{
|
197
|
+
const char *name;
|
198
|
+
unsigned char *asnoid;
|
199
|
+
int asnlen;
|
200
|
+
gcry_md_oid_spec_t *oids;
|
201
|
+
int mdlen;
|
202
|
+
gcry_md_init_t init;
|
203
|
+
gcry_md_write_t write;
|
204
|
+
gcry_md_final_t final;
|
205
|
+
gcry_md_read_t read;
|
206
|
+
size_t contextsize; /* allocate this amount of context */
|
207
|
+
} gcry_md_spec_t;
|
208
|
+
|
209
|
+
/* Register a new digest module whose specification can be found in
|
210
|
+
DIGEST. On success, a new algorithm ID is stored in ALGORITHM_ID
|
211
|
+
and a pointer representhing this module is stored in MODULE. */
|
212
|
+
gcry_error_t gcry_md_register (gcry_md_spec_t *digest,
|
213
|
+
unsigned int *algorithm_id,
|
214
|
+
gcry_module_t *module);
|
215
|
+
|
216
|
+
/* Unregister the digest identified by ID, which must have been
|
217
|
+
registered with gcry_digest_register. */
|
218
|
+
void gcry_md_unregister (gcry_module_t module);
|
219
|
+
|
220
|
+
#if 0 /* keep Emacsens's auto-indent happy */
|
221
|
+
{
|
222
|
+
#endif
|
223
|
+
#ifdef __cplusplus
|
224
|
+
}
|
225
|
+
#endif
|
226
|
+
#endif
|
@@ -0,0 +1,1826 @@
|
|
1
|
+
/* gcrypt.h - GNU Cryptographic Library Interface -*- c -*-
|
2
|
+
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
|
3
|
+
2007, 2008 Free Software Foundation, Inc.
|
4
|
+
|
5
|
+
This file is part of Libgcrypt.
|
6
|
+
|
7
|
+
Libgcrypt is free software; you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU Lesser General Public License as
|
9
|
+
published by the Free Software Foundation; either version 2.1 of
|
10
|
+
the License, or (at your option) any later version.
|
11
|
+
|
12
|
+
Libgcrypt is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU Lesser General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU Lesser General Public
|
18
|
+
License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
19
|
+
|
20
|
+
File: src/gcrypt.h. Generated from gcrypt.h.in by configure. */
|
21
|
+
|
22
|
+
#ifndef _GCRYPT_H
|
23
|
+
#define _GCRYPT_H
|
24
|
+
|
25
|
+
#include <stdlib.h>
|
26
|
+
#include <stdarg.h>
|
27
|
+
#include <string.h>
|
28
|
+
|
29
|
+
#include <gpg-error.h>
|
30
|
+
|
31
|
+
#include <sys/types.h>
|
32
|
+
|
33
|
+
#if defined _WIN32 || defined __WIN32__
|
34
|
+
# include <winsock2.h>
|
35
|
+
# include <ws2tcpip.h>
|
36
|
+
#else
|
37
|
+
# include <sys/socket.h>
|
38
|
+
#endif /*!_WIN32*/
|
39
|
+
|
40
|
+
typedef int gcry_socklen_t;
|
41
|
+
|
42
|
+
#include <sys/time.h>
|
43
|
+
|
44
|
+
/* This is required for error code compatibility. */
|
45
|
+
#define _GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GCRYPT
|
46
|
+
|
47
|
+
#ifdef __cplusplus
|
48
|
+
extern "C" {
|
49
|
+
#if 0 /* (Keep Emacsens' auto-indent happy.) */
|
50
|
+
}
|
51
|
+
#endif
|
52
|
+
#endif
|
53
|
+
|
54
|
+
/* The version of this header should match the one of the library. It
|
55
|
+
should not be used by a program because gcry_check_version() should
|
56
|
+
return the same version. The purpose of this macro is to let
|
57
|
+
autoconf (using the AM_PATH_GCRYPT macro) check that this header
|
58
|
+
matches the installed library. */
|
59
|
+
#define GCRYPT_VERSION "1.4.2"
|
60
|
+
|
61
|
+
/* Internal: We can't use the convenience macros for the multi
|
62
|
+
precision integer functions when building this library. */
|
63
|
+
#ifdef _GCRYPT_IN_LIBGCRYPT
|
64
|
+
#ifndef GCRYPT_NO_MPI_MACROS
|
65
|
+
#define GCRYPT_NO_MPI_MACROS 1
|
66
|
+
#endif
|
67
|
+
#endif
|
68
|
+
|
69
|
+
/* We want to use gcc attributes when possible. Warning: Don't use
|
70
|
+
these macros in your programs: As indicated by the leading
|
71
|
+
underscore they are subject to change without notice. */
|
72
|
+
#ifdef __GNUC__
|
73
|
+
|
74
|
+
#define _GCRY_GCC_VERSION (__GNUC__ * 10000 \
|
75
|
+
+ __GNUC_MINOR__ * 100 \
|
76
|
+
+ __GNUC_PATCHLEVEL__)
|
77
|
+
|
78
|
+
#if _GCRY_GCC_VERSION >= 30100
|
79
|
+
#define _GCRY_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
|
80
|
+
#endif
|
81
|
+
|
82
|
+
#if _GCRY_GCC_VERSION >= 29600
|
83
|
+
#define _GCRY_GCC_ATTR_PURE __attribute__ ((__pure__))
|
84
|
+
#endif
|
85
|
+
|
86
|
+
#if _GCRY_GCC_VERSION >= 30200
|
87
|
+
#define _GCRY_GCC_ATTR_MALLOC __attribute__ ((__malloc__))
|
88
|
+
#endif
|
89
|
+
|
90
|
+
#endif /*__GNUC__*/
|
91
|
+
|
92
|
+
#ifndef _GCRY_GCC_ATTR_DEPRECATED
|
93
|
+
#define _GCRY_GCC_ATTR_DEPRECATED
|
94
|
+
#endif
|
95
|
+
#ifndef _GCRY_GCC_ATTR_PURE
|
96
|
+
#define _GCRY_GCC_ATTR_PURE
|
97
|
+
#endif
|
98
|
+
#ifndef _GCRY_GCC_ATTR_MALLOC
|
99
|
+
#define _GCRY_GCC_ATTR_MALLOC
|
100
|
+
#endif
|
101
|
+
|
102
|
+
/* Some members in a public type should only be used internally.
|
103
|
+
There is no "internal" attribute, so we abuse the deprecated
|
104
|
+
attribute to discourage external use. */
|
105
|
+
#ifdef _GCRYPT_IN_LIBGCRYPT
|
106
|
+
#define _GCRY_ATTR_INTERNAL
|
107
|
+
#else
|
108
|
+
#define _GCRY_ATTR_INTERNAL _GCRY_GCC_ATTR_DEPRECATED
|
109
|
+
#endif
|
110
|
+
|
111
|
+
/* Wrappers for the libgpg-error library. */
|
112
|
+
|
113
|
+
typedef gpg_error_t gcry_error_t;
|
114
|
+
typedef gpg_err_code_t gcry_err_code_t;
|
115
|
+
typedef gpg_err_source_t gcry_err_source_t;
|
116
|
+
|
117
|
+
static GPG_ERR_INLINE gcry_error_t
|
118
|
+
gcry_err_make (gcry_err_source_t source, gcry_err_code_t code)
|
119
|
+
{
|
120
|
+
return gpg_err_make (source, code);
|
121
|
+
}
|
122
|
+
|
123
|
+
/* The user can define GPG_ERR_SOURCE_DEFAULT before including this
|
124
|
+
file to specify a default source for gpg_error. */
|
125
|
+
#ifndef GCRY_ERR_SOURCE_DEFAULT
|
126
|
+
#define GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_USER_1
|
127
|
+
#endif
|
128
|
+
|
129
|
+
static GPG_ERR_INLINE gcry_error_t
|
130
|
+
gcry_error (gcry_err_code_t code)
|
131
|
+
{
|
132
|
+
return gcry_err_make (GCRY_ERR_SOURCE_DEFAULT, code);
|
133
|
+
}
|
134
|
+
|
135
|
+
static GPG_ERR_INLINE gcry_err_code_t
|
136
|
+
gcry_err_code (gcry_error_t err)
|
137
|
+
{
|
138
|
+
return gpg_err_code (err);
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
static GPG_ERR_INLINE gcry_err_source_t
|
143
|
+
gcry_err_source (gcry_error_t err)
|
144
|
+
{
|
145
|
+
return gpg_err_source (err);
|
146
|
+
}
|
147
|
+
|
148
|
+
/* Return a pointer to a string containing a description of the error
|
149
|
+
code in the error value ERR. */
|
150
|
+
const char *gcry_strerror (gcry_error_t err);
|
151
|
+
|
152
|
+
/* Return a pointer to a string containing a description of the error
|
153
|
+
source in the error value ERR. */
|
154
|
+
const char *gcry_strsource (gcry_error_t err);
|
155
|
+
|
156
|
+
/* Retrieve the error code for the system error ERR. This returns
|
157
|
+
GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
|
158
|
+
this). */
|
159
|
+
gcry_err_code_t gcry_err_code_from_errno (int err);
|
160
|
+
|
161
|
+
/* Retrieve the system error for the error code CODE. This returns 0
|
162
|
+
if CODE is not a system error code. */
|
163
|
+
int gcry_err_code_to_errno (gcry_err_code_t code);
|
164
|
+
|
165
|
+
/* Return an error value with the error source SOURCE and the system
|
166
|
+
error ERR. */
|
167
|
+
gcry_error_t gcry_err_make_from_errno (gcry_err_source_t source, int err);
|
168
|
+
|
169
|
+
/* Return an error value with the system error ERR. */
|
170
|
+
gcry_err_code_t gcry_error_from_errno (int err);
|
171
|
+
|
172
|
+
|
173
|
+
/* This enum is deprecated; it is only declared for the sake of
|
174
|
+
complete API compatibility. */
|
175
|
+
enum gcry_thread_option
|
176
|
+
{
|
177
|
+
_GCRY_THREAD_OPTION_DUMMY
|
178
|
+
} _GCRY_GCC_ATTR_DEPRECATED;
|
179
|
+
|
180
|
+
|
181
|
+
/* Constants defining the thread model to use. Used with the OPTION
|
182
|
+
field of the struct gcry_thread_cbs. */
|
183
|
+
#define GCRY_THREAD_OPTION_DEFAULT 0
|
184
|
+
#define GCRY_THREAD_OPTION_USER 1
|
185
|
+
#define GCRY_THREAD_OPTION_PTH 2
|
186
|
+
#define GCRY_THREAD_OPTION_PTHREAD 3
|
187
|
+
|
188
|
+
/* The version number encoded in the OPTION field of the struct
|
189
|
+
gcry_thread_cbs. */
|
190
|
+
#define GCRY_THREAD_OPTION_VERSION 0
|
191
|
+
|
192
|
+
/* Wrapper for struct ath_ops. */
|
193
|
+
struct gcry_thread_cbs
|
194
|
+
{
|
195
|
+
/* The OPTION field encodes the thread model and the version number
|
196
|
+
of this structure.
|
197
|
+
Bits 7 - 0 are used for the thread model
|
198
|
+
Bits 15 - 8 are used for the version number.
|
199
|
+
*/
|
200
|
+
unsigned int option;
|
201
|
+
|
202
|
+
int (*init) (void);
|
203
|
+
int (*mutex_init) (void **priv);
|
204
|
+
int (*mutex_destroy) (void **priv);
|
205
|
+
int (*mutex_lock) (void **priv);
|
206
|
+
int (*mutex_unlock) (void **priv);
|
207
|
+
ssize_t (*read) (int fd, void *buf, size_t nbytes);
|
208
|
+
ssize_t (*write) (int fd, const void *buf, size_t nbytes);
|
209
|
+
#ifdef _WIN32
|
210
|
+
ssize_t (*select) (int nfd, void *rset, void *wset, void *eset,
|
211
|
+
struct timeval *timeout);
|
212
|
+
ssize_t (*waitpid) (pid_t pid, int *status, int options);
|
213
|
+
int (*accept) (int s, void *addr, int *length_ptr);
|
214
|
+
int (*connect) (int s, void *addr, gcry_socklen_t length);
|
215
|
+
int (*sendmsg) (int s, const void *msg, int flags);
|
216
|
+
int (*recvmsg) (int s, void *msg, int flags);
|
217
|
+
#else
|
218
|
+
ssize_t (*select) (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
|
219
|
+
struct timeval *timeout);
|
220
|
+
ssize_t (*waitpid) (pid_t pid, int *status, int options);
|
221
|
+
int (*accept) (int s, struct sockaddr *addr, gcry_socklen_t *length_ptr);
|
222
|
+
int (*connect) (int s, struct sockaddr *addr, gcry_socklen_t length);
|
223
|
+
int (*sendmsg) (int s, const struct msghdr *msg, int flags);
|
224
|
+
int (*recvmsg) (int s, struct msghdr *msg, int flags);
|
225
|
+
#endif
|
226
|
+
};
|
227
|
+
|
228
|
+
#ifdef _WIN32
|
229
|
+
# define _GCRY_THREAD_OPTION_PTH_IMPL_NET \
|
230
|
+
static ssize_t gcry_pth_select (int nfd, void *rset, void *wset, \
|
231
|
+
void *eset, struct timeval *timeout) \
|
232
|
+
{ return pth_select (nfd, rset, wset, eset, timeout); } \
|
233
|
+
static ssize_t gcry_pth_waitpid (pid_t pid, int *status, int options) \
|
234
|
+
{ return pth_waitpid (pid, status, options); } \
|
235
|
+
static int gcry_pth_accept (int s, void *addr, \
|
236
|
+
gcry_socklen_t *length_ptr) \
|
237
|
+
{ return pth_accept (s, addr, length_ptr); } \
|
238
|
+
static int gcry_pth_connect (int s, void *addr, \
|
239
|
+
gcry_socklen_t length) \
|
240
|
+
{ return pth_connect (s, addr, length); }
|
241
|
+
#else /*!_WIN32*/
|
242
|
+
# define _GCRY_THREAD_OPTION_PTH_IMPL_NET \
|
243
|
+
static ssize_t gcry_pth_select (int nfd, fd_set *rset, fd_set *wset, \
|
244
|
+
fd_set *eset, struct timeval *timeout) \
|
245
|
+
{ return pth_select (nfd, rset, wset, eset, timeout); } \
|
246
|
+
static ssize_t gcry_pth_waitpid (pid_t pid, int *status, int options) \
|
247
|
+
{ return pth_waitpid (pid, status, options); } \
|
248
|
+
static int gcry_pth_accept (int s, struct sockaddr *addr, \
|
249
|
+
gcry_socklen_t *length_ptr) \
|
250
|
+
{ return pth_accept (s, addr, length_ptr); } \
|
251
|
+
static int gcry_pth_connect (int s, struct sockaddr *addr, \
|
252
|
+
gcry_socklen_t length) \
|
253
|
+
{ return pth_connect (s, addr, length); }
|
254
|
+
#endif /*!_WIN32*/
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
#define GCRY_THREAD_OPTION_PTH_IMPL \
|
259
|
+
static int gcry_pth_init (void) \
|
260
|
+
{ return (pth_init () == FALSE) ? errno : 0; } \
|
261
|
+
static int gcry_pth_mutex_init (void **priv) \
|
262
|
+
{ \
|
263
|
+
int err = 0; \
|
264
|
+
pth_mutex_t *lock = malloc (sizeof (pth_mutex_t)); \
|
265
|
+
\
|
266
|
+
if (!lock) \
|
267
|
+
err = ENOMEM; \
|
268
|
+
if (!err) \
|
269
|
+
{ \
|
270
|
+
err = pth_mutex_init (lock); \
|
271
|
+
if (err == FALSE) \
|
272
|
+
err = errno; \
|
273
|
+
else \
|
274
|
+
err = 0; \
|
275
|
+
if (err) \
|
276
|
+
free (lock); \
|
277
|
+
else \
|
278
|
+
*priv = lock; \
|
279
|
+
} \
|
280
|
+
return err; \
|
281
|
+
} \
|
282
|
+
static int gcry_pth_mutex_destroy (void **lock) \
|
283
|
+
{ /* GNU Pth has no destructor function. */ free (*lock); return 0; } \
|
284
|
+
static int gcry_pth_mutex_lock (void **lock) \
|
285
|
+
{ return ((pth_mutex_acquire (*lock, 0, NULL)) == FALSE) \
|
286
|
+
? errno : 0; } \
|
287
|
+
static int gcry_pth_mutex_unlock (void **lock) \
|
288
|
+
{ return ((pth_mutex_release (*lock)) == FALSE) \
|
289
|
+
? errno : 0; } \
|
290
|
+
static ssize_t gcry_pth_read (int fd, void *buf, size_t nbytes) \
|
291
|
+
{ return pth_read (fd, buf, nbytes); } \
|
292
|
+
static ssize_t gcry_pth_write (int fd, const void *buf, size_t nbytes) \
|
293
|
+
{ return pth_write (fd, buf, nbytes); } \
|
294
|
+
_GCRY_THREAD_OPTION_PTH_IMPL_NET \
|
295
|
+
\
|
296
|
+
/* Note: GNU Pth is missing pth_sendmsg and pth_recvmsg. */ \
|
297
|
+
static struct gcry_thread_cbs gcry_threads_pth = { \
|
298
|
+
(GCRY_THREAD_OPTION_PTH | (GCRY_THREAD_OPTION_VERSION << 8)), \
|
299
|
+
gcry_pth_init, gcry_pth_mutex_init, gcry_pth_mutex_destroy, \
|
300
|
+
gcry_pth_mutex_lock, gcry_pth_mutex_unlock, gcry_pth_read, gcry_pth_write, \
|
301
|
+
gcry_pth_select, gcry_pth_waitpid, gcry_pth_accept, gcry_pth_connect, \
|
302
|
+
NULL, NULL }
|
303
|
+
|
304
|
+
|
305
|
+
#define GCRY_THREAD_OPTION_PTHREAD_IMPL \
|
306
|
+
static int gcry_pthread_mutex_init (void **priv) \
|
307
|
+
{ \
|
308
|
+
int err = 0; \
|
309
|
+
pthread_mutex_t *lock = (pthread_mutex_t*)malloc (sizeof (pthread_mutex_t));\
|
310
|
+
\
|
311
|
+
if (!lock) \
|
312
|
+
err = ENOMEM; \
|
313
|
+
if (!err) \
|
314
|
+
{ \
|
315
|
+
err = pthread_mutex_init (lock, NULL); \
|
316
|
+
if (err) \
|
317
|
+
free (lock); \
|
318
|
+
else \
|
319
|
+
*priv = lock; \
|
320
|
+
} \
|
321
|
+
return err; \
|
322
|
+
} \
|
323
|
+
static int gcry_pthread_mutex_destroy (void **lock) \
|
324
|
+
{ int err = pthread_mutex_destroy ((pthread_mutex_t*)*lock); \
|
325
|
+
free (*lock); return err; } \
|
326
|
+
static int gcry_pthread_mutex_lock (void **lock) \
|
327
|
+
{ return pthread_mutex_lock ((pthread_mutex_t*)*lock); } \
|
328
|
+
static int gcry_pthread_mutex_unlock (void **lock) \
|
329
|
+
{ return pthread_mutex_unlock ((pthread_mutex_t*)*lock); } \
|
330
|
+
\
|
331
|
+
static struct gcry_thread_cbs gcry_threads_pthread = { \
|
332
|
+
(GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)), \
|
333
|
+
NULL, gcry_pthread_mutex_init, gcry_pthread_mutex_destroy, \
|
334
|
+
gcry_pthread_mutex_lock, gcry_pthread_mutex_unlock, \
|
335
|
+
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
|
336
|
+
|
337
|
+
|
338
|
+
/* The data object used to hold a multi precision integer. */
|
339
|
+
struct gcry_mpi;
|
340
|
+
typedef struct gcry_mpi *gcry_mpi_t;
|
341
|
+
|
342
|
+
#ifndef GCRYPT_NO_DEPRECATED
|
343
|
+
typedef struct gcry_mpi *GCRY_MPI _GCRY_GCC_ATTR_DEPRECATED;
|
344
|
+
typedef struct gcry_mpi *GcryMPI _GCRY_GCC_ATTR_DEPRECATED;
|
345
|
+
#endif
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
/* Check that the library fulfills the version requirement. */
|
350
|
+
const char *gcry_check_version (const char *req_version);
|
351
|
+
|
352
|
+
/* Codes for function dispatchers. */
|
353
|
+
|
354
|
+
/* Codes used with the gcry_control function. */
|
355
|
+
enum gcry_ctl_cmds
|
356
|
+
{
|
357
|
+
GCRYCTL_SET_KEY = 1,
|
358
|
+
GCRYCTL_SET_IV = 2,
|
359
|
+
GCRYCTL_CFB_SYNC = 3,
|
360
|
+
GCRYCTL_RESET = 4, /* e.g. for MDs */
|
361
|
+
GCRYCTL_FINALIZE = 5,
|
362
|
+
GCRYCTL_GET_KEYLEN = 6,
|
363
|
+
GCRYCTL_GET_BLKLEN = 7,
|
364
|
+
GCRYCTL_TEST_ALGO = 8,
|
365
|
+
GCRYCTL_IS_SECURE = 9,
|
366
|
+
GCRYCTL_GET_ASNOID = 10,
|
367
|
+
GCRYCTL_ENABLE_ALGO = 11,
|
368
|
+
GCRYCTL_DISABLE_ALGO = 12,
|
369
|
+
GCRYCTL_DUMP_RANDOM_STATS = 13,
|
370
|
+
GCRYCTL_DUMP_SECMEM_STATS = 14,
|
371
|
+
GCRYCTL_GET_ALGO_NPKEY = 15,
|
372
|
+
GCRYCTL_GET_ALGO_NSKEY = 16,
|
373
|
+
GCRYCTL_GET_ALGO_NSIGN = 17,
|
374
|
+
GCRYCTL_GET_ALGO_NENCR = 18,
|
375
|
+
GCRYCTL_SET_VERBOSITY = 19,
|
376
|
+
GCRYCTL_SET_DEBUG_FLAGS = 20,
|
377
|
+
GCRYCTL_CLEAR_DEBUG_FLAGS = 21,
|
378
|
+
GCRYCTL_USE_SECURE_RNDPOOL= 22,
|
379
|
+
GCRYCTL_DUMP_MEMORY_STATS = 23,
|
380
|
+
GCRYCTL_INIT_SECMEM = 24,
|
381
|
+
GCRYCTL_TERM_SECMEM = 25,
|
382
|
+
GCRYCTL_DISABLE_SECMEM_WARN = 27,
|
383
|
+
GCRYCTL_SUSPEND_SECMEM_WARN = 28,
|
384
|
+
GCRYCTL_RESUME_SECMEM_WARN = 29,
|
385
|
+
GCRYCTL_DROP_PRIVS = 30,
|
386
|
+
GCRYCTL_ENABLE_M_GUARD = 31,
|
387
|
+
GCRYCTL_START_DUMP = 32,
|
388
|
+
GCRYCTL_STOP_DUMP = 33,
|
389
|
+
GCRYCTL_GET_ALGO_USAGE = 34,
|
390
|
+
GCRYCTL_IS_ALGO_ENABLED = 35,
|
391
|
+
GCRYCTL_DISABLE_INTERNAL_LOCKING = 36,
|
392
|
+
GCRYCTL_DISABLE_SECMEM = 37,
|
393
|
+
GCRYCTL_INITIALIZATION_FINISHED = 38,
|
394
|
+
GCRYCTL_INITIALIZATION_FINISHED_P = 39,
|
395
|
+
GCRYCTL_ANY_INITIALIZATION_P = 40,
|
396
|
+
GCRYCTL_SET_CBC_CTS = 41,
|
397
|
+
GCRYCTL_SET_CBC_MAC = 42,
|
398
|
+
GCRYCTL_SET_CTR = 43,
|
399
|
+
GCRYCTL_ENABLE_QUICK_RANDOM = 44,
|
400
|
+
GCRYCTL_SET_RANDOM_SEED_FILE = 45,
|
401
|
+
GCRYCTL_UPDATE_RANDOM_SEED_FILE = 46,
|
402
|
+
GCRYCTL_SET_THREAD_CBS = 47,
|
403
|
+
GCRYCTL_FAST_POLL = 48,
|
404
|
+
GCRYCTL_SET_RANDOM_DAEMON_SOCKET = 49,
|
405
|
+
GCRYCTL_USE_RANDOM_DAEMON = 50,
|
406
|
+
GCRYCTL_FAKED_RANDOM_P = 51,
|
407
|
+
GCRYCTL_SET_RNDEGD_SOCKET = 52,
|
408
|
+
GCRYCTL_PRINT_CONFIG = 53,
|
409
|
+
GCRYCTL_OPERATIONAL_P = 54,
|
410
|
+
GCRYCTL_FIPS_MODE_P = 55,
|
411
|
+
GCRYCTL_FORCE_FIPS_MODE = 56,
|
412
|
+
GCRYCTL_SELFTEST = 57
|
413
|
+
};
|
414
|
+
|
415
|
+
/* Perform various operations defined by CMD. */
|
416
|
+
gcry_error_t gcry_control (enum gcry_ctl_cmds CMD, ...);
|
417
|
+
|
418
|
+
|
419
|
+
/* S-expression management. */
|
420
|
+
|
421
|
+
/* The object to represent an S-expression as used with the public key
|
422
|
+
functions. */
|
423
|
+
struct gcry_sexp;
|
424
|
+
typedef struct gcry_sexp *gcry_sexp_t;
|
425
|
+
|
426
|
+
#ifndef GCRYPT_NO_DEPRECATED
|
427
|
+
typedef struct gcry_sexp *GCRY_SEXP _GCRY_GCC_ATTR_DEPRECATED;
|
428
|
+
typedef struct gcry_sexp *GcrySexp _GCRY_GCC_ATTR_DEPRECATED;
|
429
|
+
#endif
|
430
|
+
|
431
|
+
/* The possible values for the S-expression format. */
|
432
|
+
enum gcry_sexp_format
|
433
|
+
{
|
434
|
+
GCRYSEXP_FMT_DEFAULT = 0,
|
435
|
+
GCRYSEXP_FMT_CANON = 1,
|
436
|
+
GCRYSEXP_FMT_BASE64 = 2,
|
437
|
+
GCRYSEXP_FMT_ADVANCED = 3
|
438
|
+
};
|
439
|
+
|
440
|
+
/* Create an new S-expression object from BUFFER of size LENGTH and
|
441
|
+
return it in RETSEXP. With AUTODETECT set to 0 the data in BUFFER
|
442
|
+
is expected to be in canonized format. */
|
443
|
+
gcry_error_t gcry_sexp_new (gcry_sexp_t *retsexp,
|
444
|
+
const void *buffer, size_t length,
|
445
|
+
int autodetect);
|
446
|
+
|
447
|
+
/* Same as gcry_sexp_new but allows to pass a FREEFNC which has the
|
448
|
+
effect to transfer ownership of BUFFER to the created object. */
|
449
|
+
gcry_error_t gcry_sexp_create (gcry_sexp_t *retsexp,
|
450
|
+
void *buffer, size_t length,
|
451
|
+
int autodetect, void (*freefnc) (void *));
|
452
|
+
|
453
|
+
/* Scan BUFFER and return a new S-expression object in RETSEXP. This
|
454
|
+
function expects a printf like string in BUFFER. */
|
455
|
+
gcry_error_t gcry_sexp_sscan (gcry_sexp_t *retsexp, size_t *erroff,
|
456
|
+
const char *buffer, size_t length);
|
457
|
+
|
458
|
+
/* Same as gcry_sexp_sscan but expects a string in FORMAT and can thus
|
459
|
+
only be used for certain encodings. */
|
460
|
+
gcry_error_t gcry_sexp_build (gcry_sexp_t *retsexp, size_t *erroff,
|
461
|
+
const char *format, ...);
|
462
|
+
|
463
|
+
/* Like gcry_sexp_build, but uses an array instead of variable
|
464
|
+
function arguments. */
|
465
|
+
gcry_error_t gcry_sexp_build_array (gcry_sexp_t *retsexp, size_t *erroff,
|
466
|
+
const char *format, void **arg_list);
|
467
|
+
|
468
|
+
/* Release the S-expression object SEXP */
|
469
|
+
void gcry_sexp_release (gcry_sexp_t sexp);
|
470
|
+
|
471
|
+
/* Calculate the length of an canonized S-expresion in BUFFER and
|
472
|
+
check for a valid encoding. */
|
473
|
+
size_t gcry_sexp_canon_len (const unsigned char *buffer, size_t length,
|
474
|
+
size_t *erroff, gcry_error_t *errcode);
|
475
|
+
|
476
|
+
/* Copies the S-expression object SEXP into BUFFER using the format
|
477
|
+
specified in MODE. */
|
478
|
+
size_t gcry_sexp_sprint (gcry_sexp_t sexp, int mode, void *buffer,
|
479
|
+
size_t maxlength);
|
480
|
+
|
481
|
+
/* Dumps the S-expression object A in a aformat suitable for debugging
|
482
|
+
to Libgcrypt's logging stream. */
|
483
|
+
void gcry_sexp_dump (const gcry_sexp_t a);
|
484
|
+
|
485
|
+
gcry_sexp_t gcry_sexp_cons (const gcry_sexp_t a, const gcry_sexp_t b);
|
486
|
+
gcry_sexp_t gcry_sexp_alist (const gcry_sexp_t *array);
|
487
|
+
gcry_sexp_t gcry_sexp_vlist (const gcry_sexp_t a, ...);
|
488
|
+
gcry_sexp_t gcry_sexp_append (const gcry_sexp_t a, const gcry_sexp_t n);
|
489
|
+
gcry_sexp_t gcry_sexp_prepend (const gcry_sexp_t a, const gcry_sexp_t n);
|
490
|
+
|
491
|
+
/* Scan the S-expression for a sublist with a type (the car of the
|
492
|
+
list) matching the string TOKEN. If TOKLEN is not 0, the token is
|
493
|
+
assumed to be raw memory of this length. The function returns a
|
494
|
+
newly allocated S-expression consisting of the found sublist or
|
495
|
+
`NULL' when not found. */
|
496
|
+
gcry_sexp_t gcry_sexp_find_token (gcry_sexp_t list,
|
497
|
+
const char *tok, size_t toklen);
|
498
|
+
/* Return the length of the LIST. For a valid S-expression this
|
499
|
+
should be at least 1. */
|
500
|
+
int gcry_sexp_length (const gcry_sexp_t list);
|
501
|
+
|
502
|
+
/* Create and return a new S-expression from the element with index
|
503
|
+
NUMBER in LIST. Note that the first element has the index 0. If
|
504
|
+
there is no such element, `NULL' is returned. */
|
505
|
+
gcry_sexp_t gcry_sexp_nth (const gcry_sexp_t list, int number);
|
506
|
+
|
507
|
+
/* Create and return a new S-expression from the first element in
|
508
|
+
LIST; this called the "type" and should always exist and be a
|
509
|
+
string. `NULL' is returned in case of a problem. */
|
510
|
+
gcry_sexp_t gcry_sexp_car (const gcry_sexp_t list);
|
511
|
+
|
512
|
+
/* Create and return a new list form all elements except for the first
|
513
|
+
one. Note, that this function may return an invalid S-expression
|
514
|
+
because it is not guaranteed, that the type exists and is a string.
|
515
|
+
However, for parsing a complex S-expression it might be useful for
|
516
|
+
intermediate lists. Returns `NULL' on error. */
|
517
|
+
gcry_sexp_t gcry_sexp_cdr (const gcry_sexp_t list);
|
518
|
+
|
519
|
+
gcry_sexp_t gcry_sexp_cadr (const gcry_sexp_t list);
|
520
|
+
|
521
|
+
|
522
|
+
/* This function is used to get data from a LIST. A pointer to the
|
523
|
+
actual data with index NUMBER is returned and the length of this
|
524
|
+
data will be stored to DATALEN. If there is no data at the given
|
525
|
+
index or the index represents another list, `NULL' is returned.
|
526
|
+
*Note:* The returned pointer is valid as long as LIST is not
|
527
|
+
modified or released. */
|
528
|
+
const char *gcry_sexp_nth_data (const gcry_sexp_t list, int number,
|
529
|
+
size_t *datalen);
|
530
|
+
|
531
|
+
/* This function is used to get and convert data from a LIST. The
|
532
|
+
data is assumed to be a Nul terminated string. The caller must
|
533
|
+
release the returned value using `gcry_free'. If there is no data
|
534
|
+
at the given index, the index represents a list or the value can't
|
535
|
+
be converted to a string, `NULL' is returned. */
|
536
|
+
char *gcry_sexp_nth_string (gcry_sexp_t list, int number);
|
537
|
+
|
538
|
+
/* This function is used to get and convert data from a LIST. This
|
539
|
+
data is assumed to be an MPI stored in the format described by
|
540
|
+
MPIFMT and returned as a standard Libgcrypt MPI. The caller must
|
541
|
+
release this returned value using `gcry_mpi_release'. If there is
|
542
|
+
no data at the given index, the index represents a list or the
|
543
|
+
value can't be converted to an MPI, `NULL' is returned. */
|
544
|
+
gcry_mpi_t gcry_sexp_nth_mpi (gcry_sexp_t list, int number, int mpifmt);
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
/*******************************************
|
549
|
+
* *
|
550
|
+
* Multi Precision Integer Functions *
|
551
|
+
* *
|
552
|
+
*******************************************/
|
553
|
+
|
554
|
+
/* Different formats of external big integer representation. */
|
555
|
+
enum gcry_mpi_format
|
556
|
+
{
|
557
|
+
GCRYMPI_FMT_NONE= 0,
|
558
|
+
GCRYMPI_FMT_STD = 1, /* Twos complement stored without length. */
|
559
|
+
GCRYMPI_FMT_PGP = 2, /* As used by OpenPGP (unsigned only). */
|
560
|
+
GCRYMPI_FMT_SSH = 3, /* As used by SSH (like STD but with length). */
|
561
|
+
GCRYMPI_FMT_HEX = 4, /* Hex format. */
|
562
|
+
GCRYMPI_FMT_USG = 5 /* Like STD but unsigned. */
|
563
|
+
};
|
564
|
+
|
565
|
+
/* Flags used for creating big integers. */
|
566
|
+
enum gcry_mpi_flag
|
567
|
+
{
|
568
|
+
GCRYMPI_FLAG_SECURE = 1, /* Allocate the number in "secure" memory. */
|
569
|
+
GCRYMPI_FLAG_OPAQUE = 2 /* The number is not a real one but just
|
570
|
+
a way to store some bytes. This is
|
571
|
+
useful for encrypted big integers. */
|
572
|
+
};
|
573
|
+
|
574
|
+
|
575
|
+
/* Allocate a new big integer object, initialize it with 0 and
|
576
|
+
initially allocate memory for a number of at least NBITS. */
|
577
|
+
gcry_mpi_t gcry_mpi_new (unsigned int nbits);
|
578
|
+
|
579
|
+
/* Same as gcry_mpi_new() but allocate in "secure" memory. */
|
580
|
+
gcry_mpi_t gcry_mpi_snew (unsigned int nbits);
|
581
|
+
|
582
|
+
/* Release the number A and free all associated resources. */
|
583
|
+
void gcry_mpi_release (gcry_mpi_t a);
|
584
|
+
|
585
|
+
/* Create a new number with the same value as A. */
|
586
|
+
gcry_mpi_t gcry_mpi_copy (const gcry_mpi_t a);
|
587
|
+
|
588
|
+
/* Store the big integer value U in W. */
|
589
|
+
gcry_mpi_t gcry_mpi_set (gcry_mpi_t w, const gcry_mpi_t u);
|
590
|
+
|
591
|
+
/* Store the unsigned integer value U in W. */
|
592
|
+
gcry_mpi_t gcry_mpi_set_ui (gcry_mpi_t w, unsigned long u);
|
593
|
+
|
594
|
+
/* Swap the values of A and B. */
|
595
|
+
void gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b);
|
596
|
+
|
597
|
+
/* Compare the big integer number U and V returning 0 for equality, a
|
598
|
+
positive value for U > V and a negative for U < V. */
|
599
|
+
int gcry_mpi_cmp (const gcry_mpi_t u, const gcry_mpi_t v);
|
600
|
+
|
601
|
+
/* Compare the big integer number U with the unsigned integer V
|
602
|
+
returning 0 for equality, a positive value for U > V and a negative
|
603
|
+
for U < V. */
|
604
|
+
int gcry_mpi_cmp_ui (const gcry_mpi_t u, unsigned long v);
|
605
|
+
|
606
|
+
/* Convert the external representation of an integer stored in BUFFER
|
607
|
+
with a length of BUFLEN into a newly create MPI returned in
|
608
|
+
RET_MPI. If NSCANNED is not NULL, it will receive the number of
|
609
|
+
bytes actually scanned after a successful operation. */
|
610
|
+
gcry_error_t gcry_mpi_scan (gcry_mpi_t *ret_mpi, enum gcry_mpi_format format,
|
611
|
+
const void *buffer, size_t buflen,
|
612
|
+
size_t *nscanned);
|
613
|
+
|
614
|
+
/* Convert the big integer A into the external representation
|
615
|
+
described by FORMAT and store it in the provided BUFFER which has
|
616
|
+
been allocated by the user with a size of BUFLEN bytes. NWRITTEN
|
617
|
+
receives the actual length of the external representation unless it
|
618
|
+
has been passed as NULL. */
|
619
|
+
gcry_error_t gcry_mpi_print (enum gcry_mpi_format format,
|
620
|
+
unsigned char *buffer, size_t buflen,
|
621
|
+
size_t *nwritten,
|
622
|
+
const gcry_mpi_t a);
|
623
|
+
|
624
|
+
/* Convert the big integer A int the external representation described
|
625
|
+
by FORMAT and store it in a newly allocated buffer which address
|
626
|
+
will be put into BUFFER. NWRITTEN receives the actual lengths of the
|
627
|
+
external representation. */
|
628
|
+
gcry_error_t gcry_mpi_aprint (enum gcry_mpi_format format,
|
629
|
+
unsigned char **buffer, size_t *nwritten,
|
630
|
+
const gcry_mpi_t a);
|
631
|
+
|
632
|
+
/* Dump the value of A in a format suitable for debugging to
|
633
|
+
Libgcrypt's logging stream. Note that one leading space but no
|
634
|
+
trailing space or linefeed will be printed. It is okay to pass
|
635
|
+
NULL for A. */
|
636
|
+
void gcry_mpi_dump (const gcry_mpi_t a);
|
637
|
+
|
638
|
+
|
639
|
+
/* W = U + V. */
|
640
|
+
void gcry_mpi_add (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v);
|
641
|
+
|
642
|
+
/* W = U + V. V is an unsigned integer. */
|
643
|
+
void gcry_mpi_add_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v);
|
644
|
+
|
645
|
+
/* W = U + V mod M. */
|
646
|
+
void gcry_mpi_addm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m);
|
647
|
+
|
648
|
+
/* W = U - V. */
|
649
|
+
void gcry_mpi_sub (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v);
|
650
|
+
|
651
|
+
/* W = U - V. V is an unsigned integer. */
|
652
|
+
void gcry_mpi_sub_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v );
|
653
|
+
|
654
|
+
/* W = U - V mod M */
|
655
|
+
void gcry_mpi_subm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m);
|
656
|
+
|
657
|
+
/* W = U * V. */
|
658
|
+
void gcry_mpi_mul (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v);
|
659
|
+
|
660
|
+
/* W = U * V. V is an unsigned integer. */
|
661
|
+
void gcry_mpi_mul_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v );
|
662
|
+
|
663
|
+
/* W = U * V mod M. */
|
664
|
+
void gcry_mpi_mulm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m);
|
665
|
+
|
666
|
+
/* W = U * (2 ^ CNT). */
|
667
|
+
void gcry_mpi_mul_2exp (gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt);
|
668
|
+
|
669
|
+
/* Q = DIVIDEND / DIVISOR, R = DIVIDEND % DIVISOR,
|
670
|
+
Q or R may be passed as NULL. ROUND should be negative or 0. */
|
671
|
+
void gcry_mpi_div (gcry_mpi_t q, gcry_mpi_t r,
|
672
|
+
gcry_mpi_t dividend, gcry_mpi_t divisor, int round);
|
673
|
+
|
674
|
+
/* R = DIVIDEND % DIVISOR */
|
675
|
+
void gcry_mpi_mod (gcry_mpi_t r, gcry_mpi_t dividend, gcry_mpi_t divisor);
|
676
|
+
|
677
|
+
/* W = B ^ E mod M. */
|
678
|
+
void gcry_mpi_powm (gcry_mpi_t w,
|
679
|
+
const gcry_mpi_t b, const gcry_mpi_t e,
|
680
|
+
const gcry_mpi_t m);
|
681
|
+
|
682
|
+
/* Set G to the greatest common divisor of A and B.
|
683
|
+
Return true if the G is 1. */
|
684
|
+
int gcry_mpi_gcd (gcry_mpi_t g, gcry_mpi_t a, gcry_mpi_t b);
|
685
|
+
|
686
|
+
/* Set X to the multiplicative inverse of A mod M.
|
687
|
+
Return true if the value exists. */
|
688
|
+
int gcry_mpi_invm (gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t m);
|
689
|
+
|
690
|
+
|
691
|
+
/* Return the number of bits required to represent A. */
|
692
|
+
unsigned int gcry_mpi_get_nbits (gcry_mpi_t a);
|
693
|
+
|
694
|
+
/* Return true when bit number N (counting from 0) is set in A. */
|
695
|
+
int gcry_mpi_test_bit (gcry_mpi_t a, unsigned int n);
|
696
|
+
|
697
|
+
/* Set bit number N in A. */
|
698
|
+
void gcry_mpi_set_bit (gcry_mpi_t a, unsigned int n);
|
699
|
+
|
700
|
+
/* Clear bit number N in A. */
|
701
|
+
void gcry_mpi_clear_bit (gcry_mpi_t a, unsigned int n);
|
702
|
+
|
703
|
+
/* Set bit number N in A and clear all bits greater than N. */
|
704
|
+
void gcry_mpi_set_highbit (gcry_mpi_t a, unsigned int n);
|
705
|
+
|
706
|
+
/* Clear bit number N in A and all bits greater than N. */
|
707
|
+
void gcry_mpi_clear_highbit (gcry_mpi_t a, unsigned int n);
|
708
|
+
|
709
|
+
/* Shift the value of A by N bits to the right and store the result in X. */
|
710
|
+
void gcry_mpi_rshift (gcry_mpi_t x, gcry_mpi_t a, unsigned int n);
|
711
|
+
|
712
|
+
/* Shift the value of A by N bits to the left and store the result in X. */
|
713
|
+
void gcry_mpi_lshift (gcry_mpi_t x, gcry_mpi_t a, unsigned int n);
|
714
|
+
|
715
|
+
/* Store NBITS of the value P points to in A and mark A as an opaque
|
716
|
+
value. WARNING: Never use an opaque MPI for anything thing else then
|
717
|
+
gcry_mpi_release, gcry_mpi_get_opaque. */
|
718
|
+
gcry_mpi_t gcry_mpi_set_opaque (gcry_mpi_t a, void *p, unsigned int nbits);
|
719
|
+
|
720
|
+
/* Return a pointer to an opaque value stored in A and return its size
|
721
|
+
in NBITS. Note that the returned pointer is still owned by A and
|
722
|
+
that the function should never be used for an non-opaque MPI. */
|
723
|
+
void *gcry_mpi_get_opaque (gcry_mpi_t a, unsigned int *nbits);
|
724
|
+
|
725
|
+
/* Set the FLAG for the big integer A. Currently only the flag
|
726
|
+
GCRYMPI_FLAG_SECURE is allowed to convert A into an big intger
|
727
|
+
stored in "secure" memory. */
|
728
|
+
void gcry_mpi_set_flag (gcry_mpi_t a, enum gcry_mpi_flag flag);
|
729
|
+
|
730
|
+
/* Clear FLAG for the big integer A. Note that this function is
|
731
|
+
currently useless as no flags are allowed. */
|
732
|
+
void gcry_mpi_clear_flag (gcry_mpi_t a, enum gcry_mpi_flag flag);
|
733
|
+
|
734
|
+
/* Return true when the FLAG is set for A. */
|
735
|
+
int gcry_mpi_get_flag (gcry_mpi_t a, enum gcry_mpi_flag flag);
|
736
|
+
|
737
|
+
/* Unless the GCRYPT_NO_MPI_MACROS is used, provide a couple of
|
738
|
+
convenience macros for the big integer functions. */
|
739
|
+
#ifndef GCRYPT_NO_MPI_MACROS
|
740
|
+
#define mpi_new(n) gcry_mpi_new( (n) )
|
741
|
+
#define mpi_secure_new( n ) gcry_mpi_snew( (n) )
|
742
|
+
#define mpi_release(a) \
|
743
|
+
do \
|
744
|
+
{ \
|
745
|
+
gcry_mpi_release ((a)); \
|
746
|
+
(a) = NULL; \
|
747
|
+
} \
|
748
|
+
while (0)
|
749
|
+
|
750
|
+
#define mpi_copy( a ) gcry_mpi_copy( (a) )
|
751
|
+
#define mpi_set( w, u) gcry_mpi_set( (w), (u) )
|
752
|
+
#define mpi_set_ui( w, u) gcry_mpi_set_ui( (w), (u) )
|
753
|
+
#define mpi_cmp( u, v ) gcry_mpi_cmp( (u), (v) )
|
754
|
+
#define mpi_cmp_ui( u, v ) gcry_mpi_cmp_ui( (u), (v) )
|
755
|
+
|
756
|
+
#define mpi_add_ui(w,u,v) gcry_mpi_add_ui((w),(u),(v))
|
757
|
+
#define mpi_add(w,u,v) gcry_mpi_add ((w),(u),(v))
|
758
|
+
#define mpi_addm(w,u,v,m) gcry_mpi_addm ((w),(u),(v),(m))
|
759
|
+
#define mpi_sub_ui(w,u,v) gcry_mpi_sub_ui ((w),(u),(v))
|
760
|
+
#define mpi_sub(w,u,v) gcry_mpi_sub ((w),(u),(v))
|
761
|
+
#define mpi_subm(w,u,v,m) gcry_mpi_subm ((w),(u),(v),(m))
|
762
|
+
#define mpi_mul_ui(w,u,v) gcry_mpi_mul_ui ((w),(u),(v))
|
763
|
+
#define mpi_mul_2exp(w,u,v) gcry_mpi_mul_2exp ((w),(u),(v))
|
764
|
+
#define mpi_mul(w,u,v) gcry_mpi_mul ((w),(u),(v))
|
765
|
+
#define mpi_mulm(w,u,v,m) gcry_mpi_mulm ((w),(u),(v),(m))
|
766
|
+
#define mpi_powm(w,b,e,m) gcry_mpi_powm ( (w), (b), (e), (m) )
|
767
|
+
#define mpi_tdiv(q,r,a,m) gcry_mpi_div ( (q), (r), (a), (m), 0)
|
768
|
+
#define mpi_fdiv(q,r,a,m) gcry_mpi_div ( (q), (r), (a), (m), -1)
|
769
|
+
#define mpi_mod(r,a,m) gcry_mpi_mod ((r), (a), (m))
|
770
|
+
#define mpi_gcd(g,a,b) gcry_mpi_gcd ( (g), (a), (b) )
|
771
|
+
#define mpi_invm(g,a,b) gcry_mpi_invm ( (g), (a), (b) )
|
772
|
+
|
773
|
+
#define mpi_get_nbits(a) gcry_mpi_get_nbits ((a))
|
774
|
+
#define mpi_test_bit(a,b) gcry_mpi_test_bit ((a),(b))
|
775
|
+
#define mpi_set_bit(a,b) gcry_mpi_set_bit ((a),(b))
|
776
|
+
#define mpi_set_highbit(a,b) gcry_mpi_set_highbit ((a),(b))
|
777
|
+
#define mpi_clear_bit(a,b) gcry_mpi_clear_bit ((a),(b))
|
778
|
+
#define mpi_clear_highbit(a,b) gcry_mpi_clear_highbit ((a),(b))
|
779
|
+
#define mpi_rshift(a,b,c) gcry_mpi_rshift ((a),(b),(c))
|
780
|
+
#define mpi_lshift(a,b,c) gcry_mpi_lshift ((a),(b),(c))
|
781
|
+
|
782
|
+
#define mpi_set_opaque(a,b,c) gcry_mpi_set_opaque( (a), (b), (c) )
|
783
|
+
#define mpi_get_opaque(a,b) gcry_mpi_get_opaque( (a), (b) )
|
784
|
+
#endif /* GCRYPT_NO_MPI_MACROS */
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
/************************************
|
789
|
+
* *
|
790
|
+
* Symmetric Cipher Functions *
|
791
|
+
* *
|
792
|
+
************************************/
|
793
|
+
|
794
|
+
/* The data object used to hold a handle to an encryption object. */
|
795
|
+
struct gcry_cipher_handle;
|
796
|
+
typedef struct gcry_cipher_handle *gcry_cipher_hd_t;
|
797
|
+
|
798
|
+
#ifndef GCRYPT_NO_DEPRECATED
|
799
|
+
typedef struct gcry_cipher_handle *GCRY_CIPHER_HD _GCRY_GCC_ATTR_DEPRECATED;
|
800
|
+
typedef struct gcry_cipher_handle *GcryCipherHd _GCRY_GCC_ATTR_DEPRECATED;
|
801
|
+
#endif
|
802
|
+
|
803
|
+
/* All symmetric encryption algorithms are identified by their IDs.
|
804
|
+
More IDs may be registered at runtime. */
|
805
|
+
enum gcry_cipher_algos
|
806
|
+
{
|
807
|
+
GCRY_CIPHER_NONE = 0,
|
808
|
+
GCRY_CIPHER_IDEA = 1,
|
809
|
+
GCRY_CIPHER_3DES = 2,
|
810
|
+
GCRY_CIPHER_CAST5 = 3,
|
811
|
+
GCRY_CIPHER_BLOWFISH = 4,
|
812
|
+
GCRY_CIPHER_SAFER_SK128 = 5,
|
813
|
+
GCRY_CIPHER_DES_SK = 6,
|
814
|
+
GCRY_CIPHER_AES = 7,
|
815
|
+
GCRY_CIPHER_AES192 = 8,
|
816
|
+
GCRY_CIPHER_AES256 = 9,
|
817
|
+
GCRY_CIPHER_TWOFISH = 10,
|
818
|
+
|
819
|
+
/* Other cipher numbers are above 300 for OpenPGP reasons. */
|
820
|
+
GCRY_CIPHER_ARCFOUR = 301, /* Fully compatible with RSA's RC4 (tm). */
|
821
|
+
GCRY_CIPHER_DES = 302, /* Yes, this is single key 56 bit DES. */
|
822
|
+
GCRY_CIPHER_TWOFISH128 = 303,
|
823
|
+
GCRY_CIPHER_SERPENT128 = 304,
|
824
|
+
GCRY_CIPHER_SERPENT192 = 305,
|
825
|
+
GCRY_CIPHER_SERPENT256 = 306,
|
826
|
+
GCRY_CIPHER_RFC2268_40 = 307, /* Ron's Cipher 2 (40 bit). */
|
827
|
+
GCRY_CIPHER_RFC2268_128 = 308, /* Ron's Cipher 2 (128 bit). */
|
828
|
+
GCRY_CIPHER_SEED = 309, /* 128 bit cipher described in RFC4269. */
|
829
|
+
GCRY_CIPHER_CAMELLIA128 = 310,
|
830
|
+
GCRY_CIPHER_CAMELLIA192 = 311,
|
831
|
+
GCRY_CIPHER_CAMELLIA256 = 312
|
832
|
+
};
|
833
|
+
|
834
|
+
/* The Rijndael algorithm is basically AES, so provide some macros. */
|
835
|
+
#define GCRY_CIPHER_AES128 GCRY_CIPHER_AES
|
836
|
+
#define GCRY_CIPHER_RIJNDAEL GCRY_CIPHER_AES
|
837
|
+
#define GCRY_CIPHER_RIJNDAEL128 GCRY_CIPHER_AES128
|
838
|
+
#define GCRY_CIPHER_RIJNDAEL192 GCRY_CIPHER_AES192
|
839
|
+
#define GCRY_CIPHER_RIJNDAEL256 GCRY_CIPHER_AES256
|
840
|
+
|
841
|
+
/* The supported encryption modes. Note that not all of them are
|
842
|
+
supported for each algorithm. */
|
843
|
+
enum gcry_cipher_modes
|
844
|
+
{
|
845
|
+
GCRY_CIPHER_MODE_NONE = 0, /* Not yet specified. */
|
846
|
+
GCRY_CIPHER_MODE_ECB = 1, /* Electronic codebook. */
|
847
|
+
GCRY_CIPHER_MODE_CFB = 2, /* Cipher feedback. */
|
848
|
+
GCRY_CIPHER_MODE_CBC = 3, /* Cipher block chaining. */
|
849
|
+
GCRY_CIPHER_MODE_STREAM = 4, /* Used with stream ciphers. */
|
850
|
+
GCRY_CIPHER_MODE_OFB = 5, /* Outer feedback. */
|
851
|
+
GCRY_CIPHER_MODE_CTR = 6 /* Counter. */
|
852
|
+
};
|
853
|
+
|
854
|
+
/* Flags used with the open function. */
|
855
|
+
enum gcry_cipher_flags
|
856
|
+
{
|
857
|
+
GCRY_CIPHER_SECURE = 1, /* Allocate in secure memory. */
|
858
|
+
GCRY_CIPHER_ENABLE_SYNC = 2, /* Enable CFB sync mode. */
|
859
|
+
GCRY_CIPHER_CBC_CTS = 4, /* Enable CBC cipher text stealing (CTS). */
|
860
|
+
GCRY_CIPHER_CBC_MAC = 8 /* Enable CBC message auth. code (MAC). */
|
861
|
+
};
|
862
|
+
|
863
|
+
|
864
|
+
/* Create a handle for algorithm ALGO to be used in MODE. FLAGS may
|
865
|
+
be given as an bitwise OR of the gcry_cipher_flags values. */
|
866
|
+
gcry_error_t gcry_cipher_open (gcry_cipher_hd_t *handle,
|
867
|
+
int algo, int mode, unsigned int flags);
|
868
|
+
|
869
|
+
/* Close the cioher handle H and release all resource. */
|
870
|
+
void gcry_cipher_close (gcry_cipher_hd_t h);
|
871
|
+
|
872
|
+
/* Perform various operations on the cipher object H. */
|
873
|
+
gcry_error_t gcry_cipher_ctl (gcry_cipher_hd_t h, int cmd, void *buffer,
|
874
|
+
size_t buflen);
|
875
|
+
|
876
|
+
/* Retrieve various information about the cipher object H. */
|
877
|
+
gcry_error_t gcry_cipher_info (gcry_cipher_hd_t h, int what, void *buffer,
|
878
|
+
size_t *nbytes);
|
879
|
+
|
880
|
+
/* Retrieve various information about the cipher algorithm ALGO. */
|
881
|
+
gcry_error_t gcry_cipher_algo_info (int algo, int what, void *buffer,
|
882
|
+
size_t *nbytes);
|
883
|
+
|
884
|
+
/* Map the cipher algorithm whose ID is contained in ALGORITHM to a
|
885
|
+
string representation of the algorithm name. For unknown algorithm
|
886
|
+
IDs this function returns "?". */
|
887
|
+
const char *gcry_cipher_algo_name (int algorithm) _GCRY_GCC_ATTR_PURE;
|
888
|
+
|
889
|
+
/* Map the algorithm name NAME to an cipher algorithm ID. Return 0 if
|
890
|
+
the algorithm name is not known. */
|
891
|
+
int gcry_cipher_map_name (const char *name) _GCRY_GCC_ATTR_PURE;
|
892
|
+
|
893
|
+
/* Given an ASN.1 object identifier in standard IETF dotted decimal
|
894
|
+
format in STRING, return the encryption mode associated with that
|
895
|
+
OID or 0 if not known or applicable. */
|
896
|
+
int gcry_cipher_mode_from_oid (const char *string) _GCRY_GCC_ATTR_PURE;
|
897
|
+
|
898
|
+
/* Encrypt the plaintext of size INLEN in IN using the cipher handle H
|
899
|
+
into the buffer OUT which has an allocated length of OUTSIZE. For
|
900
|
+
most algorithms it is possible to pass NULL for in and 0 for INLEN
|
901
|
+
and do a in-place decryption of the data provided in OUT. */
|
902
|
+
gcry_error_t gcry_cipher_encrypt (gcry_cipher_hd_t h,
|
903
|
+
void *out, size_t outsize,
|
904
|
+
const void *in, size_t inlen);
|
905
|
+
|
906
|
+
/* The counterpart to gcry_cipher_encrypt. */
|
907
|
+
gcry_error_t gcry_cipher_decrypt (gcry_cipher_hd_t h,
|
908
|
+
void *out, size_t outsize,
|
909
|
+
const void *in, size_t inlen);
|
910
|
+
|
911
|
+
/* Set KEY of length KEYLEN for the cipher handle HD. */
|
912
|
+
gcry_error_t gcry_cipher_setkey (gcry_cipher_hd_t hd,
|
913
|
+
const void *key, size_t keylen);
|
914
|
+
|
915
|
+
|
916
|
+
/* Set initialization vector IV of length IVLEN for the cipher handle HD. */
|
917
|
+
gcry_error_t gcry_cipher_setiv (gcry_cipher_hd_t hd,
|
918
|
+
const void *iv, size_t ivlen);
|
919
|
+
|
920
|
+
|
921
|
+
/* Reset the handle to the state after open. */
|
922
|
+
#define gcry_cipher_reset(h) gcry_cipher_ctl ((h), GCRYCTL_RESET, NULL, 0)
|
923
|
+
|
924
|
+
/* Perform the OpenPGP sync operation if this is enabled for the
|
925
|
+
cipher handle H. */
|
926
|
+
#define gcry_cipher_sync(h) gcry_cipher_ctl( (h), GCRYCTL_CFB_SYNC, NULL, 0)
|
927
|
+
|
928
|
+
/* Enable or disable CTS in future calls to gcry_encrypt(). CBC mode only. */
|
929
|
+
#define gcry_cipher_cts(h,on) gcry_cipher_ctl( (h), GCRYCTL_SET_CBC_CTS, \
|
930
|
+
NULL, on )
|
931
|
+
|
932
|
+
/* Set counter for CTR mode. (CTR,CTRLEN) must denote a buffer of
|
933
|
+
block size length, or (NULL,0) to set the CTR to the all-zero block. */
|
934
|
+
gpg_error_t gcry_cipher_setctr (gcry_cipher_hd_t hd,
|
935
|
+
const void *ctr, size_t ctrlen);
|
936
|
+
|
937
|
+
/* Retrieved the key length used with algorithm A. */
|
938
|
+
size_t gcry_cipher_get_algo_keylen (int algo);
|
939
|
+
|
940
|
+
/* Retrieve the block length used with algorithm A. */
|
941
|
+
size_t gcry_cipher_get_algo_blklen (int algo);
|
942
|
+
|
943
|
+
/* Return 0 if the algorithm A is available for use. */
|
944
|
+
#define gcry_cipher_test_algo(a) \
|
945
|
+
gcry_cipher_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL )
|
946
|
+
|
947
|
+
/* Get a list consisting of the IDs of the loaded cipher modules. If
|
948
|
+
LIST is zero, write the number of loaded cipher modules to
|
949
|
+
LIST_LENGTH and return. If LIST is non-zero, the first
|
950
|
+
*LIST_LENGTH algorithm IDs are stored in LIST, which must be of
|
951
|
+
according size. In case there are less cipher modules than
|
952
|
+
*LIST_LENGTH, *LIST_LENGTH is updated to the correct number. */
|
953
|
+
gcry_error_t gcry_cipher_list (int *list, int *list_length);
|
954
|
+
|
955
|
+
|
956
|
+
/************************************
|
957
|
+
* *
|
958
|
+
* Asymmetric Cipher Functions *
|
959
|
+
* *
|
960
|
+
************************************/
|
961
|
+
|
962
|
+
/* The algorithms and their IDs we support. */
|
963
|
+
enum gcry_pk_algos
|
964
|
+
{
|
965
|
+
GCRY_PK_RSA = 1,
|
966
|
+
GCRY_PK_RSA_E = 2, /* (deprecated) */
|
967
|
+
GCRY_PK_RSA_S = 3, /* (deprecated) */
|
968
|
+
GCRY_PK_ELG_E = 16,
|
969
|
+
GCRY_PK_DSA = 17,
|
970
|
+
GCRY_PK_ELG = 20,
|
971
|
+
GCRY_PK_ECDSA = 301
|
972
|
+
};
|
973
|
+
|
974
|
+
/* Flags describing usage capabilities of a PK algorithm. */
|
975
|
+
#define GCRY_PK_USAGE_SIGN 1 /* Good for signatures. */
|
976
|
+
#define GCRY_PK_USAGE_ENCR 2 /* Good for encryption. */
|
977
|
+
#define GCRY_PK_USAGE_CERT 4 /* Good to certify other keys. */
|
978
|
+
#define GCRY_PK_USAGE_AUTH 8 /* Good for authentication. */
|
979
|
+
#define GCRY_PK_USAGE_UNKN 128 /* Unknown usage flag. */
|
980
|
+
|
981
|
+
/* Encrypt the DATA using the public key PKEY and store the result as
|
982
|
+
a newly created S-expression at RESULT. */
|
983
|
+
gcry_error_t gcry_pk_encrypt (gcry_sexp_t *result,
|
984
|
+
gcry_sexp_t data, gcry_sexp_t pkey);
|
985
|
+
|
986
|
+
/* Decrypt the DATA using the private key SKEY and store the result as
|
987
|
+
a newly created S-expression at RESULT. */
|
988
|
+
gcry_error_t gcry_pk_decrypt (gcry_sexp_t *result,
|
989
|
+
gcry_sexp_t data, gcry_sexp_t skey);
|
990
|
+
|
991
|
+
/* Sign the DATA using the private key SKEY and store the result as
|
992
|
+
a newly created S-expression at RESULT. */
|
993
|
+
gcry_error_t gcry_pk_sign (gcry_sexp_t *result,
|
994
|
+
gcry_sexp_t data, gcry_sexp_t skey);
|
995
|
+
|
996
|
+
/* Check the signature SIGVAL on DATA using the public key PKEY. */
|
997
|
+
gcry_error_t gcry_pk_verify (gcry_sexp_t sigval,
|
998
|
+
gcry_sexp_t data, gcry_sexp_t pkey);
|
999
|
+
|
1000
|
+
/* Check that private KEY is sane. */
|
1001
|
+
gcry_error_t gcry_pk_testkey (gcry_sexp_t key);
|
1002
|
+
|
1003
|
+
/* Generate a new key pair according to the parameters given in
|
1004
|
+
S_PARMS. The new key pair is returned in as an S-expression in
|
1005
|
+
R_KEY. */
|
1006
|
+
gcry_error_t gcry_pk_genkey (gcry_sexp_t *r_key, gcry_sexp_t s_parms);
|
1007
|
+
|
1008
|
+
/* Catch all function for miscellaneous operations. */
|
1009
|
+
gcry_error_t gcry_pk_ctl (int cmd, void *buffer, size_t buflen);
|
1010
|
+
|
1011
|
+
/* Retrieve information about the public key algorithm ALGO. */
|
1012
|
+
gcry_error_t gcry_pk_algo_info (int algo, int what,
|
1013
|
+
void *buffer, size_t *nbytes);
|
1014
|
+
|
1015
|
+
/* Map the public key algorithm whose ID is contained in ALGORITHM to
|
1016
|
+
a string representation of the algorithm name. For unknown
|
1017
|
+
algorithm IDs this functions returns "?". */
|
1018
|
+
const char *gcry_pk_algo_name (int algorithm) _GCRY_GCC_ATTR_PURE;
|
1019
|
+
|
1020
|
+
/* Map the algorithm NAME to a public key algorithm Id. Return 0 if
|
1021
|
+
the algorithm name is not known. */
|
1022
|
+
int gcry_pk_map_name (const char* name) _GCRY_GCC_ATTR_PURE;
|
1023
|
+
|
1024
|
+
/* Return what is commonly referred as the key length for the given
|
1025
|
+
public or private KEY. */
|
1026
|
+
unsigned int gcry_pk_get_nbits (gcry_sexp_t key) _GCRY_GCC_ATTR_PURE;
|
1027
|
+
|
1028
|
+
/* Please note that keygrip is still experimental and should not be
|
1029
|
+
used without contacting the author. */
|
1030
|
+
unsigned char *gcry_pk_get_keygrip (gcry_sexp_t key, unsigned char *array);
|
1031
|
+
|
1032
|
+
/* Return 0 if the public key algorithm A is available for use. */
|
1033
|
+
#define gcry_pk_test_algo(a) \
|
1034
|
+
gcry_pk_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL )
|
1035
|
+
|
1036
|
+
/* Get a list consisting of the IDs of the loaded pubkey modules. If
|
1037
|
+
LIST is zero, write the number of loaded pubkey modules to
|
1038
|
+
LIST_LENGTH and return. If LIST is non-zero, the first
|
1039
|
+
*LIST_LENGTH algorithm IDs are stored in LIST, which must be of
|
1040
|
+
according size. In case there are less pubkey modules than
|
1041
|
+
*LIST_LENGTH, *LIST_LENGTH is updated to the correct number. */
|
1042
|
+
gcry_error_t gcry_pk_list (int *list, int *list_length);
|
1043
|
+
|
1044
|
+
|
1045
|
+
|
1046
|
+
/************************************
|
1047
|
+
* *
|
1048
|
+
* Cryptograhic Hash Functions *
|
1049
|
+
* *
|
1050
|
+
************************************/
|
1051
|
+
|
1052
|
+
/* Algorithm IDs for the hash functions we know about. Not all of them
|
1053
|
+
are implemnted. */
|
1054
|
+
enum gcry_md_algos
|
1055
|
+
{
|
1056
|
+
GCRY_MD_NONE = 0,
|
1057
|
+
GCRY_MD_MD5 = 1,
|
1058
|
+
GCRY_MD_SHA1 = 2,
|
1059
|
+
GCRY_MD_RMD160 = 3,
|
1060
|
+
GCRY_MD_MD2 = 5,
|
1061
|
+
GCRY_MD_TIGER = 6, /* TIGER/192. */
|
1062
|
+
GCRY_MD_HAVAL = 7, /* HAVAL, 5 pass, 160 bit. */
|
1063
|
+
GCRY_MD_SHA256 = 8,
|
1064
|
+
GCRY_MD_SHA384 = 9,
|
1065
|
+
GCRY_MD_SHA512 = 10,
|
1066
|
+
GCRY_MD_SHA224 = 11,
|
1067
|
+
GCRY_MD_MD4 = 301,
|
1068
|
+
GCRY_MD_CRC32 = 302,
|
1069
|
+
GCRY_MD_CRC32_RFC1510 = 303,
|
1070
|
+
GCRY_MD_CRC24_RFC2440 = 304,
|
1071
|
+
GCRY_MD_WHIRLPOOL = 305
|
1072
|
+
};
|
1073
|
+
|
1074
|
+
/* Flags used with the open function. */
|
1075
|
+
enum gcry_md_flags
|
1076
|
+
{
|
1077
|
+
GCRY_MD_FLAG_SECURE = 1, /* Allocate all buffers in "secure" memory. */
|
1078
|
+
GCRY_MD_FLAG_HMAC = 2 /* Make an HMAC out of this algorithm. */
|
1079
|
+
};
|
1080
|
+
|
1081
|
+
/* (Forward declaration.) */
|
1082
|
+
struct gcry_md_context;
|
1083
|
+
|
1084
|
+
/* This object is used to hold a handle to a message digest object.
|
1085
|
+
This structure is private - only to be used by the public gcry_md_*
|
1086
|
+
macros. */
|
1087
|
+
typedef struct gcry_md_handle
|
1088
|
+
{
|
1089
|
+
/* Actual context. */
|
1090
|
+
struct gcry_md_context *ctx;
|
1091
|
+
|
1092
|
+
/* Buffer management. */
|
1093
|
+
int bufpos;
|
1094
|
+
int bufsize;
|
1095
|
+
unsigned char buf[1];
|
1096
|
+
} *gcry_md_hd_t;
|
1097
|
+
|
1098
|
+
/* Compatibility types, do not use them. */
|
1099
|
+
#ifndef GCRYPT_NO_DEPRECATED
|
1100
|
+
typedef struct gcry_md_handle *GCRY_MD_HD _GCRY_GCC_ATTR_DEPRECATED;
|
1101
|
+
typedef struct gcry_md_handle *GcryMDHd _GCRY_GCC_ATTR_DEPRECATED;
|
1102
|
+
#endif
|
1103
|
+
|
1104
|
+
/* Create a message digest object for algorithm ALGO. FLAGS may be
|
1105
|
+
given as an bitwise OR of the gcry_md_flags values. ALGO may be
|
1106
|
+
given as 0 if the algorithms to be used are later set using
|
1107
|
+
gcry_md_enable. */
|
1108
|
+
gcry_error_t gcry_md_open (gcry_md_hd_t *h, int algo, unsigned int flags);
|
1109
|
+
|
1110
|
+
/* Release the message digest object HD. */
|
1111
|
+
void gcry_md_close (gcry_md_hd_t hd);
|
1112
|
+
|
1113
|
+
/* Add the message digest algorithm ALGO to the digest object HD. */
|
1114
|
+
gcry_error_t gcry_md_enable (gcry_md_hd_t hd, int algo);
|
1115
|
+
|
1116
|
+
/* Create a new digest object as an exact copy of the object HD. */
|
1117
|
+
gcry_error_t gcry_md_copy (gcry_md_hd_t *bhd, gcry_md_hd_t ahd);
|
1118
|
+
|
1119
|
+
/* Reset the digest object HD to its initial state. */
|
1120
|
+
void gcry_md_reset (gcry_md_hd_t hd);
|
1121
|
+
|
1122
|
+
/* Perform various operations on the digest object HD. */
|
1123
|
+
gcry_error_t gcry_md_ctl (gcry_md_hd_t hd, int cmd,
|
1124
|
+
void *buffer, size_t buflen);
|
1125
|
+
|
1126
|
+
/* Pass LENGTH bytes of data in BUFFER to the digest object HD so that
|
1127
|
+
it can update the digest values. This is the actual hash
|
1128
|
+
function. */
|
1129
|
+
void gcry_md_write (gcry_md_hd_t hd, const void *buffer, size_t length);
|
1130
|
+
|
1131
|
+
/* Read out the final digest from HD return the digest value for
|
1132
|
+
algorithm ALGO. */
|
1133
|
+
unsigned char *gcry_md_read (gcry_md_hd_t hd, int algo);
|
1134
|
+
|
1135
|
+
/* Convenience function to calculate the hash from the data in BUFFER
|
1136
|
+
of size LENGTH using the algorithm ALGO avoiding the creating of a
|
1137
|
+
hash object. The hash is returned in the caller provided buffer
|
1138
|
+
DIGEST which must be large enough to hold the digest of the given
|
1139
|
+
algorithm. */
|
1140
|
+
void gcry_md_hash_buffer (int algo, void *digest,
|
1141
|
+
const void *buffer, size_t length);
|
1142
|
+
|
1143
|
+
/* Retrieve the algorithm used with HD. This does not work reliable
|
1144
|
+
if more than one algorithm is enabled in HD. */
|
1145
|
+
int gcry_md_get_algo (gcry_md_hd_t hd);
|
1146
|
+
|
1147
|
+
/* Retrieve the length in bytes of the digest yielded by algorithm
|
1148
|
+
ALGO. */
|
1149
|
+
unsigned int gcry_md_get_algo_dlen (int algo);
|
1150
|
+
|
1151
|
+
/* Return true if the the algorithm ALGO is enabled in the digest
|
1152
|
+
object A. */
|
1153
|
+
int gcry_md_is_enabled (gcry_md_hd_t a, int algo);
|
1154
|
+
|
1155
|
+
/* Return true if the digest object A is allocated in "secure" memory. */
|
1156
|
+
int gcry_md_is_secure (gcry_md_hd_t a);
|
1157
|
+
|
1158
|
+
/* Retrieve various information about the object H. */
|
1159
|
+
gcry_error_t gcry_md_info (gcry_md_hd_t h, int what, void *buffer,
|
1160
|
+
size_t *nbytes);
|
1161
|
+
|
1162
|
+
/* Retrieve various information about the algorithm ALGO. */
|
1163
|
+
gcry_error_t gcry_md_algo_info (int algo, int what, void *buffer,
|
1164
|
+
size_t *nbytes);
|
1165
|
+
|
1166
|
+
/* Map the digest algorithm id ALGO to a string representation of the
|
1167
|
+
algorithm name. For unknown algorithms this functions returns
|
1168
|
+
"?". */
|
1169
|
+
const char *gcry_md_algo_name (int algo) _GCRY_GCC_ATTR_PURE;
|
1170
|
+
|
1171
|
+
/* Map the algorithm NAME to a digest algorithm Id. Return 0 if
|
1172
|
+
the algorithm name is not known. */
|
1173
|
+
int gcry_md_map_name (const char* name) _GCRY_GCC_ATTR_PURE;
|
1174
|
+
|
1175
|
+
/* For use with the HMAC feature, the set MAC key to the KEY of
|
1176
|
+
KEYLEN. */
|
1177
|
+
gcry_error_t gcry_md_setkey (gcry_md_hd_t hd, const void *key, size_t keylen);
|
1178
|
+
|
1179
|
+
/* Start or stop debugging for digest handle HD; i.e. create a file
|
1180
|
+
named dbgmd-<n>.<suffix> while hashing. If SUFFIX is NULL,
|
1181
|
+
debugging stops and the file will be closed. */
|
1182
|
+
void gcry_md_debug (gcry_md_hd_t hd, const char *suffix);
|
1183
|
+
|
1184
|
+
|
1185
|
+
/* Update the hash(s) of H with the character C. This is a buffered
|
1186
|
+
version of the gcry_md_write function. */
|
1187
|
+
#define gcry_md_putc(h,c) \
|
1188
|
+
do { \
|
1189
|
+
gcry_md_hd_t h__ = (h); \
|
1190
|
+
if( (h__)->bufpos == (h__)->bufsize ) \
|
1191
|
+
gcry_md_write( (h__), NULL, 0 ); \
|
1192
|
+
(h__)->buf[(h__)->bufpos++] = (c) & 0xff; \
|
1193
|
+
} while(0)
|
1194
|
+
|
1195
|
+
/* Finalize the digest calculation. This is not really needed because
|
1196
|
+
gcry_md_read() does this implicitly. */
|
1197
|
+
#define gcry_md_final(a) \
|
1198
|
+
gcry_md_ctl ((a), GCRYCTL_FINALIZE, NULL, 0)
|
1199
|
+
|
1200
|
+
/* Return 0 if the algorithm A is available for use. */
|
1201
|
+
#define gcry_md_test_algo(a) \
|
1202
|
+
gcry_md_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL )
|
1203
|
+
|
1204
|
+
/* Return an DER encoded ASN.1 OID for the algorithm A in buffer B. N
|
1205
|
+
must point to size_t variable with the available size of buffer B.
|
1206
|
+
After return it will receive the actual size of the returned
|
1207
|
+
OID. */
|
1208
|
+
#define gcry_md_get_asnoid(a,b,n) \
|
1209
|
+
gcry_md_algo_info((a), GCRYCTL_GET_ASNOID, (b), (n))
|
1210
|
+
|
1211
|
+
/* Enable debugging for digest object A; i.e. create files named
|
1212
|
+
dbgmd-<n>.<string> while hashing. B is a string used as the suffix
|
1213
|
+
for the filename. This macro is deprecated, use gcry_md_debug. */
|
1214
|
+
#ifndef GCRYPT_NO_DEPRECATED
|
1215
|
+
#define gcry_md_start_debug(a,b) \
|
1216
|
+
gcry_md_ctl( (a), GCRYCTL_START_DUMP, (b), 0 )
|
1217
|
+
|
1218
|
+
/* Disable the debugging of A. This macro is deprecated, use
|
1219
|
+
gcry_md_debug. */
|
1220
|
+
#define gcry_md_stop_debug(a,b) \
|
1221
|
+
gcry_md_ctl( (a), GCRYCTL_STOP_DUMP, (b), 0 )
|
1222
|
+
#endif
|
1223
|
+
|
1224
|
+
/* Get a list consisting of the IDs of the loaded message digest
|
1225
|
+
modules. If LIST is zero, write the number of loaded message
|
1226
|
+
digest modules to LIST_LENGTH and return. If LIST is non-zero, the
|
1227
|
+
first *LIST_LENGTH algorithm IDs are stored in LIST, which must be
|
1228
|
+
of according size. In case there are less message digest modules
|
1229
|
+
than *LIST_LENGTH, *LIST_LENGTH is updated to the correct
|
1230
|
+
number. */
|
1231
|
+
gcry_error_t gcry_md_list (int *list, int *list_length);
|
1232
|
+
|
1233
|
+
|
1234
|
+
|
1235
|
+
/* Alternative interface for asymmetric cryptography. This interface
|
1236
|
+
is deprecated. */
|
1237
|
+
|
1238
|
+
/* The algorithm IDs. */
|
1239
|
+
typedef enum gcry_ac_id
|
1240
|
+
{
|
1241
|
+
GCRY_AC_RSA = 1,
|
1242
|
+
GCRY_AC_DSA = 17,
|
1243
|
+
GCRY_AC_ELG = 20,
|
1244
|
+
GCRY_AC_ELG_E = 16
|
1245
|
+
}
|
1246
|
+
gcry_ac_id_t;
|
1247
|
+
|
1248
|
+
/* Key types. */
|
1249
|
+
typedef enum gcry_ac_key_type
|
1250
|
+
{
|
1251
|
+
GCRY_AC_KEY_SECRET,
|
1252
|
+
GCRY_AC_KEY_PUBLIC
|
1253
|
+
}
|
1254
|
+
gcry_ac_key_type_t;
|
1255
|
+
|
1256
|
+
/* Encoding methods. */
|
1257
|
+
typedef enum gcry_ac_em
|
1258
|
+
{
|
1259
|
+
GCRY_AC_EME_PKCS_V1_5,
|
1260
|
+
GCRY_AC_EMSA_PKCS_V1_5
|
1261
|
+
}
|
1262
|
+
gcry_ac_em_t;
|
1263
|
+
|
1264
|
+
/* Encryption and Signature schemes. */
|
1265
|
+
typedef enum gcry_ac_scheme
|
1266
|
+
{
|
1267
|
+
GCRY_AC_ES_PKCS_V1_5,
|
1268
|
+
GCRY_AC_SSA_PKCS_V1_5
|
1269
|
+
}
|
1270
|
+
gcry_ac_scheme_t;
|
1271
|
+
|
1272
|
+
/* AC data. */
|
1273
|
+
#define GCRY_AC_FLAG_DEALLOC (1 << 0)
|
1274
|
+
#define GCRY_AC_FLAG_COPY (1 << 1)
|
1275
|
+
#define GCRY_AC_FLAG_NO_BLINDING (1 << 2)
|
1276
|
+
|
1277
|
+
/* This type represents a `data set'. */
|
1278
|
+
typedef struct gcry_ac_data *gcry_ac_data_t;
|
1279
|
+
|
1280
|
+
/* This type represents a single `key', either a secret one or a
|
1281
|
+
public one. */
|
1282
|
+
typedef struct gcry_ac_key *gcry_ac_key_t;
|
1283
|
+
|
1284
|
+
/* This type represents a `key pair' containing a secret and a public
|
1285
|
+
key. */
|
1286
|
+
typedef struct gcry_ac_key_pair *gcry_ac_key_pair_t;
|
1287
|
+
|
1288
|
+
/* This type represents a `handle' that is needed by functions
|
1289
|
+
performing cryptographic operations. */
|
1290
|
+
typedef struct gcry_ac_handle *gcry_ac_handle_t;
|
1291
|
+
|
1292
|
+
typedef gpg_error_t (*gcry_ac_data_read_cb_t) (void *opaque,
|
1293
|
+
unsigned char *buffer,
|
1294
|
+
size_t *buffer_n);
|
1295
|
+
|
1296
|
+
typedef gpg_error_t (*gcry_ac_data_write_cb_t) (void *opaque,
|
1297
|
+
unsigned char *buffer,
|
1298
|
+
size_t buffer_n);
|
1299
|
+
|
1300
|
+
typedef enum
|
1301
|
+
{
|
1302
|
+
GCRY_AC_IO_READABLE,
|
1303
|
+
GCRY_AC_IO_WRITABLE
|
1304
|
+
}
|
1305
|
+
gcry_ac_io_mode_t;
|
1306
|
+
|
1307
|
+
typedef enum
|
1308
|
+
{
|
1309
|
+
GCRY_AC_IO_STRING,
|
1310
|
+
GCRY_AC_IO_CALLBACK
|
1311
|
+
}
|
1312
|
+
gcry_ac_io_type_t;
|
1313
|
+
|
1314
|
+
typedef struct gcry_ac_io
|
1315
|
+
{
|
1316
|
+
/* This is an INTERNAL structure, do NOT use manually. */
|
1317
|
+
gcry_ac_io_mode_t mode _GCRY_ATTR_INTERNAL;
|
1318
|
+
gcry_ac_io_type_t type _GCRY_ATTR_INTERNAL;
|
1319
|
+
union
|
1320
|
+
{
|
1321
|
+
union
|
1322
|
+
{
|
1323
|
+
struct
|
1324
|
+
{
|
1325
|
+
gcry_ac_data_read_cb_t cb;
|
1326
|
+
void *opaque;
|
1327
|
+
} callback;
|
1328
|
+
struct
|
1329
|
+
{
|
1330
|
+
unsigned char *data;
|
1331
|
+
size_t data_n;
|
1332
|
+
} string;
|
1333
|
+
void *opaque;
|
1334
|
+
} readable;
|
1335
|
+
union
|
1336
|
+
{
|
1337
|
+
struct
|
1338
|
+
{
|
1339
|
+
gcry_ac_data_write_cb_t cb;
|
1340
|
+
void *opaque;
|
1341
|
+
} callback;
|
1342
|
+
struct
|
1343
|
+
{
|
1344
|
+
unsigned char **data;
|
1345
|
+
size_t *data_n;
|
1346
|
+
} string;
|
1347
|
+
void *opaque;
|
1348
|
+
} writable;
|
1349
|
+
} io _GCRY_ATTR_INTERNAL;
|
1350
|
+
}
|
1351
|
+
gcry_ac_io_t;
|
1352
|
+
|
1353
|
+
/* The caller of gcry_ac_key_pair_generate can provide one of these
|
1354
|
+
structures in order to influence the key generation process in an
|
1355
|
+
algorithm-specific way. */
|
1356
|
+
typedef struct gcry_ac_key_spec_rsa
|
1357
|
+
{
|
1358
|
+
gcry_mpi_t e; /* E to use. */
|
1359
|
+
} gcry_ac_key_spec_rsa_t;
|
1360
|
+
|
1361
|
+
/* Structure used for passing data to the implementation of the
|
1362
|
+
`EME-PKCS-V1_5' encoding method. */
|
1363
|
+
typedef struct gcry_ac_eme_pkcs_v1_5
|
1364
|
+
{
|
1365
|
+
size_t key_size;
|
1366
|
+
} gcry_ac_eme_pkcs_v1_5_t;
|
1367
|
+
|
1368
|
+
typedef enum gcry_md_algos gcry_md_algo_t;
|
1369
|
+
|
1370
|
+
/* Structure used for passing data to the implementation of the
|
1371
|
+
`EMSA-PKCS-V1_5' encoding method. */
|
1372
|
+
typedef struct gcry_ac_emsa_pkcs_v1_5
|
1373
|
+
{
|
1374
|
+
gcry_md_algo_t md;
|
1375
|
+
size_t em_n;
|
1376
|
+
} gcry_ac_emsa_pkcs_v1_5_t;
|
1377
|
+
|
1378
|
+
/* Structure used for passing data to the implementation of the
|
1379
|
+
`SSA-PKCS-V1_5' signature scheme. */
|
1380
|
+
typedef struct gcry_ac_ssa_pkcs_v1_5
|
1381
|
+
{
|
1382
|
+
gcry_md_algo_t md;
|
1383
|
+
} gcry_ac_ssa_pkcs_v1_5_t;
|
1384
|
+
|
1385
|
+
/* Returns a new, empty data set in DATA. */
|
1386
|
+
gcry_error_t gcry_ac_data_new (gcry_ac_data_t *data);
|
1387
|
+
|
1388
|
+
/* Destroy the data set DATA. */
|
1389
|
+
void gcry_ac_data_destroy (gcry_ac_data_t data);
|
1390
|
+
|
1391
|
+
/* Create a copy of the data set DATA and store it in DATA_CP. */
|
1392
|
+
gcry_error_t gcry_ac_data_copy (gcry_ac_data_t *data_cp,
|
1393
|
+
gcry_ac_data_t data);
|
1394
|
+
|
1395
|
+
/* Return the number of named MPI values inside of the data set
|
1396
|
+
DATA. */
|
1397
|
+
unsigned int gcry_ac_data_length (gcry_ac_data_t data);
|
1398
|
+
|
1399
|
+
/* Destroy any values contained in the data set DATA. */
|
1400
|
+
void gcry_ac_data_clear (gcry_ac_data_t data);
|
1401
|
+
|
1402
|
+
/* Add the value MPI to DATA with the label NAME. If FLAGS contains
|
1403
|
+
GCRY_AC_FLAG_DATA_COPY, the data set will contain copies of NAME
|
1404
|
+
and MPI. If FLAGS contains GCRY_AC_FLAG_DATA_DEALLOC or
|
1405
|
+
GCRY_AC_FLAG_DATA_COPY, the values contained in the data set will
|
1406
|
+
be deallocated when they are to be removed from the data set. */
|
1407
|
+
gcry_error_t gcry_ac_data_set (gcry_ac_data_t data, unsigned int flags,
|
1408
|
+
const char *name, gcry_mpi_t mpi);
|
1409
|
+
|
1410
|
+
/* Store the value labelled with NAME found in DATA in MPI. If FLAGS
|
1411
|
+
contains GCRY_AC_FLAG_COPY, store a copy of the MPI value contained
|
1412
|
+
in the data set. MPI may be NULL. */
|
1413
|
+
gcry_error_t gcry_ac_data_get_name (gcry_ac_data_t data, unsigned int flags,
|
1414
|
+
const char *name, gcry_mpi_t *mpi);
|
1415
|
+
|
1416
|
+
/* Stores in NAME and MPI the named MPI value contained in the data
|
1417
|
+
set DATA with the index IDX. If FLAGS contains GCRY_AC_FLAG_COPY,
|
1418
|
+
store copies of the values contained in the data set. NAME or MPI
|
1419
|
+
may be NULL. */
|
1420
|
+
gcry_error_t gcry_ac_data_get_index (gcry_ac_data_t data, unsigned int flags,
|
1421
|
+
unsigned int idx,
|
1422
|
+
const char **name, gcry_mpi_t *mpi);
|
1423
|
+
|
1424
|
+
/* Convert the data set DATA into a new S-Expression, which is to be
|
1425
|
+
stored in SEXP, according to the identifiers contained in
|
1426
|
+
IDENTIFIERS. */
|
1427
|
+
gcry_error_t gcry_ac_data_to_sexp (gcry_ac_data_t data, gcry_sexp_t *sexp,
|
1428
|
+
const char **identifiers);
|
1429
|
+
|
1430
|
+
/* Create a new data set, which is to be stored in DATA_SET, from the
|
1431
|
+
S-Expression SEXP, according to the identifiers contained in
|
1432
|
+
IDENTIFIERS. */
|
1433
|
+
gcry_error_t gcry_ac_data_from_sexp (gcry_ac_data_t *data, gcry_sexp_t sexp,
|
1434
|
+
const char **identifiers);
|
1435
|
+
|
1436
|
+
/* Initialize AC_IO according to MODE, TYPE and the variable list of
|
1437
|
+
arguments. The list of variable arguments to specify depends on
|
1438
|
+
the given TYPE. */
|
1439
|
+
void gcry_ac_io_init (gcry_ac_io_t *ac_io, gcry_ac_io_mode_t mode,
|
1440
|
+
gcry_ac_io_type_t type, ...);
|
1441
|
+
|
1442
|
+
/* Initialize AC_IO according to MODE, TYPE and the variable list of
|
1443
|
+
arguments AP. The list of variable arguments to specify depends on
|
1444
|
+
the given TYPE. */
|
1445
|
+
void gcry_ac_io_init_va (gcry_ac_io_t *ac_io, gcry_ac_io_mode_t mode,
|
1446
|
+
gcry_ac_io_type_t type, va_list ap);
|
1447
|
+
|
1448
|
+
/* Create a new ac handle. */
|
1449
|
+
gcry_error_t gcry_ac_open (gcry_ac_handle_t *handle,
|
1450
|
+
gcry_ac_id_t algorithm, unsigned int flags);
|
1451
|
+
|
1452
|
+
/* Destroy an ac handle. */
|
1453
|
+
void gcry_ac_close (gcry_ac_handle_t handle);
|
1454
|
+
|
1455
|
+
/* Initialize a key from a given data set. */
|
1456
|
+
gcry_error_t gcry_ac_key_init (gcry_ac_key_t *key, gcry_ac_handle_t handle,
|
1457
|
+
gcry_ac_key_type_t type, gcry_ac_data_t data);
|
1458
|
+
|
1459
|
+
/* Generates a new key pair via the handle HANDLE of NBITS bits and
|
1460
|
+
stores it in KEY_PAIR. In case non-standard settings are wanted, a
|
1461
|
+
pointer to a structure of type gcry_ac_key_spec_<algorithm>_t,
|
1462
|
+
matching the selected algorithm, can be given as KEY_SPEC.
|
1463
|
+
MISC_DATA is not used yet. */
|
1464
|
+
gcry_error_t gcry_ac_key_pair_generate (gcry_ac_handle_t handle,
|
1465
|
+
unsigned int nbits, void *spec,
|
1466
|
+
gcry_ac_key_pair_t *key_pair,
|
1467
|
+
gcry_mpi_t **misc_data);
|
1468
|
+
|
1469
|
+
/* Returns the key of type WHICH out of the key pair KEY_PAIR. */
|
1470
|
+
gcry_ac_key_t gcry_ac_key_pair_extract (gcry_ac_key_pair_t key_pair,
|
1471
|
+
gcry_ac_key_type_t which);
|
1472
|
+
|
1473
|
+
/* Returns the data set contained in the key KEY. */
|
1474
|
+
gcry_ac_data_t gcry_ac_key_data_get (gcry_ac_key_t key);
|
1475
|
+
|
1476
|
+
/* Verifies that the key KEY is sane via HANDLE. */
|
1477
|
+
gcry_error_t gcry_ac_key_test (gcry_ac_handle_t handle, gcry_ac_key_t key);
|
1478
|
+
|
1479
|
+
/* Stores the number of bits of the key KEY in NBITS via HANDLE. */
|
1480
|
+
gcry_error_t gcry_ac_key_get_nbits (gcry_ac_handle_t handle,
|
1481
|
+
gcry_ac_key_t key, unsigned int *nbits);
|
1482
|
+
|
1483
|
+
/* Writes the 20 byte long key grip of the key KEY to KEY_GRIP via
|
1484
|
+
HANDLE. */
|
1485
|
+
gcry_error_t gcry_ac_key_get_grip (gcry_ac_handle_t handle, gcry_ac_key_t key,
|
1486
|
+
unsigned char *key_grip);
|
1487
|
+
|
1488
|
+
/* Destroy a key. */
|
1489
|
+
void gcry_ac_key_destroy (gcry_ac_key_t key);
|
1490
|
+
|
1491
|
+
/* Destroy a key pair. */
|
1492
|
+
void gcry_ac_key_pair_destroy (gcry_ac_key_pair_t key_pair);
|
1493
|
+
|
1494
|
+
/* Encodes a message according to the encoding method METHOD. OPTIONS
|
1495
|
+
must be a pointer to a method-specific structure
|
1496
|
+
(gcry_ac_em*_t). */
|
1497
|
+
gcry_error_t gcry_ac_data_encode (gcry_ac_em_t method,
|
1498
|
+
unsigned int flags, void *options,
|
1499
|
+
gcry_ac_io_t *io_read,
|
1500
|
+
gcry_ac_io_t *io_write);
|
1501
|
+
|
1502
|
+
/* Decodes a message according to the encoding method METHOD. OPTIONS
|
1503
|
+
must be a pointer to a method-specific structure
|
1504
|
+
(gcry_ac_em*_t). */
|
1505
|
+
gcry_error_t gcry_ac_data_decode (gcry_ac_em_t method,
|
1506
|
+
unsigned int flags, void *options,
|
1507
|
+
gcry_ac_io_t *io_read,
|
1508
|
+
gcry_ac_io_t *io_write);
|
1509
|
+
|
1510
|
+
/* Encrypt the plain text MPI value DATA_PLAIN with the key KEY under
|
1511
|
+
the control of the flags FLAGS and store the resulting data set
|
1512
|
+
into DATA_ENCRYPTED. */
|
1513
|
+
gcry_error_t gcry_ac_data_encrypt (gcry_ac_handle_t handle,
|
1514
|
+
unsigned int flags,
|
1515
|
+
gcry_ac_key_t key,
|
1516
|
+
gcry_mpi_t data_plain,
|
1517
|
+
gcry_ac_data_t *data_encrypted);
|
1518
|
+
|
1519
|
+
/* Decrypt the decrypted data contained in the data set DATA_ENCRYPTED
|
1520
|
+
with the key KEY under the control of the flags FLAGS and store the
|
1521
|
+
resulting plain text MPI value in DATA_PLAIN. */
|
1522
|
+
gcry_error_t gcry_ac_data_decrypt (gcry_ac_handle_t handle,
|
1523
|
+
unsigned int flags,
|
1524
|
+
gcry_ac_key_t key,
|
1525
|
+
gcry_mpi_t *data_plain,
|
1526
|
+
gcry_ac_data_t data_encrypted);
|
1527
|
+
|
1528
|
+
/* Sign the data contained in DATA with the key KEY and store the
|
1529
|
+
resulting signature in the data set DATA_SIGNATURE. */
|
1530
|
+
gcry_error_t gcry_ac_data_sign (gcry_ac_handle_t handle,
|
1531
|
+
gcry_ac_key_t key,
|
1532
|
+
gcry_mpi_t data,
|
1533
|
+
gcry_ac_data_t *data_signature);
|
1534
|
+
|
1535
|
+
/* Verify that the signature contained in the data set DATA_SIGNATURE
|
1536
|
+
is indeed the result of signing the data contained in DATA with the
|
1537
|
+
secret key belonging to the public key KEY. */
|
1538
|
+
gcry_error_t gcry_ac_data_verify (gcry_ac_handle_t handle,
|
1539
|
+
gcry_ac_key_t key,
|
1540
|
+
gcry_mpi_t data,
|
1541
|
+
gcry_ac_data_t data_signature);
|
1542
|
+
|
1543
|
+
/* Encrypts the plain text readable from IO_MESSAGE through HANDLE
|
1544
|
+
with the public key KEY according to SCHEME, FLAGS and OPTS. If
|
1545
|
+
OPTS is not NULL, it has to be a pointer to a structure specific to
|
1546
|
+
the chosen scheme (gcry_ac_es_*_t). The encrypted message is
|
1547
|
+
written to IO_CIPHER. */
|
1548
|
+
gcry_error_t gcry_ac_data_encrypt_scheme (gcry_ac_handle_t handle,
|
1549
|
+
gcry_ac_scheme_t scheme,
|
1550
|
+
unsigned int flags, void *opts,
|
1551
|
+
gcry_ac_key_t key,
|
1552
|
+
gcry_ac_io_t *io_message,
|
1553
|
+
gcry_ac_io_t *io_cipher);
|
1554
|
+
|
1555
|
+
/* Decrypts the cipher text readable from IO_CIPHER through HANDLE
|
1556
|
+
with the secret key KEY according to SCHEME, @var{flags} and OPTS.
|
1557
|
+
If OPTS is not NULL, it has to be a pointer to a structure specific
|
1558
|
+
to the chosen scheme (gcry_ac_es_*_t). The decrypted message is
|
1559
|
+
written to IO_MESSAGE. */
|
1560
|
+
gcry_error_t gcry_ac_data_decrypt_scheme (gcry_ac_handle_t handle,
|
1561
|
+
gcry_ac_scheme_t scheme,
|
1562
|
+
unsigned int flags, void *opts,
|
1563
|
+
gcry_ac_key_t key,
|
1564
|
+
gcry_ac_io_t *io_cipher,
|
1565
|
+
gcry_ac_io_t *io_message);
|
1566
|
+
|
1567
|
+
/* Signs the message readable from IO_MESSAGE through HANDLE with the
|
1568
|
+
secret key KEY according to SCHEME, FLAGS and OPTS. If OPTS is not
|
1569
|
+
NULL, it has to be a pointer to a structure specific to the chosen
|
1570
|
+
scheme (gcry_ac_ssa_*_t). The signature is written to
|
1571
|
+
IO_SIGNATURE. */
|
1572
|
+
gcry_error_t gcry_ac_data_sign_scheme (gcry_ac_handle_t handle,
|
1573
|
+
gcry_ac_scheme_t scheme,
|
1574
|
+
unsigned int flags, void *opts,
|
1575
|
+
gcry_ac_key_t key,
|
1576
|
+
gcry_ac_io_t *io_message,
|
1577
|
+
gcry_ac_io_t *io_signature);
|
1578
|
+
|
1579
|
+
/* Verifies through HANDLE that the signature readable from
|
1580
|
+
IO_SIGNATURE is indeed the result of signing the message readable
|
1581
|
+
from IO_MESSAGE with the secret key belonging to the public key KEY
|
1582
|
+
according to SCHEME and OPTS. If OPTS is not NULL, it has to be an
|
1583
|
+
anonymous structure (gcry_ac_ssa_*_t) specific to the chosen
|
1584
|
+
scheme. */
|
1585
|
+
gcry_error_t gcry_ac_data_verify_scheme (gcry_ac_handle_t handle,
|
1586
|
+
gcry_ac_scheme_t scheme,
|
1587
|
+
unsigned int flags, void *opts,
|
1588
|
+
gcry_ac_key_t key,
|
1589
|
+
gcry_ac_io_t *io_message,
|
1590
|
+
gcry_ac_io_t *io_signature);
|
1591
|
+
|
1592
|
+
/* Store the textual representation of the algorithm whose id is given
|
1593
|
+
in ALGORITHM in NAME. This function is deprecated; use
|
1594
|
+
gcry_pk_algo_name. */
|
1595
|
+
#ifndef GCRYPT_NO_DEPRECATED
|
1596
|
+
gcry_error_t gcry_ac_id_to_name (gcry_ac_id_t algorithm,
|
1597
|
+
const char **name)
|
1598
|
+
/* */ _GCRY_GCC_ATTR_DEPRECATED;
|
1599
|
+
/* Store the numeric ID of the algorithm whose textual representation
|
1600
|
+
is contained in NAME in ALGORITHM. This function is deprecated;
|
1601
|
+
use gcry_pk_map_name. */
|
1602
|
+
gcry_error_t gcry_ac_name_to_id (const char *name,
|
1603
|
+
gcry_ac_id_t *algorithm)
|
1604
|
+
/* */ _GCRY_GCC_ATTR_DEPRECATED;
|
1605
|
+
#endif
|
1606
|
+
|
1607
|
+
|
1608
|
+
/************************************
|
1609
|
+
* *
|
1610
|
+
* Random Generating Functions *
|
1611
|
+
* *
|
1612
|
+
************************************/
|
1613
|
+
|
1614
|
+
/* The possible values for the random quality. The rule of thumb is
|
1615
|
+
to use STRONG for session keys and VERY_STRONG for key material.
|
1616
|
+
WEAK is usually an alias for STRONG and should not be used anymore
|
1617
|
+
(except with gcry_mpi_randomize); use gcry_create_nonce instead. */
|
1618
|
+
typedef enum gcry_random_level
|
1619
|
+
{
|
1620
|
+
GCRY_WEAK_RANDOM = 0,
|
1621
|
+
GCRY_STRONG_RANDOM = 1,
|
1622
|
+
GCRY_VERY_STRONG_RANDOM = 2
|
1623
|
+
}
|
1624
|
+
gcry_random_level_t;
|
1625
|
+
|
1626
|
+
/* Fill BUFFER with LENGTH bytes of random, using random numbers of
|
1627
|
+
quality LEVEL. */
|
1628
|
+
void gcry_randomize (void *buffer, size_t length,
|
1629
|
+
enum gcry_random_level level);
|
1630
|
+
|
1631
|
+
/* Add the external random from BUFFER with LENGTH bytes into the
|
1632
|
+
pool. QUALITY should either be -1 for unknown or in the range of 0
|
1633
|
+
to 100 */
|
1634
|
+
gcry_error_t gcry_random_add_bytes (const void *buffer, size_t length,
|
1635
|
+
int quality);
|
1636
|
+
|
1637
|
+
/* If random numbers are used in an application, this macro should be
|
1638
|
+
called from time to time so that new stuff gets added to the
|
1639
|
+
internal pool of the RNG. */
|
1640
|
+
#define gcry_fast_random_poll() gcry_control (GCRYCTL_FAST_POLL, NULL)
|
1641
|
+
|
1642
|
+
|
1643
|
+
/* Return NBYTES of allocated random using a random numbers of quality
|
1644
|
+
LEVEL. */
|
1645
|
+
void *gcry_random_bytes (size_t nbytes, enum gcry_random_level level)
|
1646
|
+
_GCRY_GCC_ATTR_MALLOC;
|
1647
|
+
|
1648
|
+
/* Return NBYTES of allocated random using a random numbers of quality
|
1649
|
+
LEVEL. The random numbers are created returned in "secure"
|
1650
|
+
memory. */
|
1651
|
+
void *gcry_random_bytes_secure (size_t nbytes, enum gcry_random_level level)
|
1652
|
+
_GCRY_GCC_ATTR_MALLOC;
|
1653
|
+
|
1654
|
+
|
1655
|
+
/* Set the big integer W to a random value of NBITS using a random
|
1656
|
+
generator with quality LEVEL. Note that using a level of
|
1657
|
+
GCRY_WEAK_RANDOM here, uses gcry_create_nonce internally. */
|
1658
|
+
void gcry_mpi_randomize (gcry_mpi_t w,
|
1659
|
+
unsigned int nbits, enum gcry_random_level level);
|
1660
|
+
|
1661
|
+
|
1662
|
+
/* Create an unpredicable nonce of LENGTH bytes in BUFFER. */
|
1663
|
+
void gcry_create_nonce (void *buffer, size_t length);
|
1664
|
+
|
1665
|
+
|
1666
|
+
|
1667
|
+
|
1668
|
+
|
1669
|
+
/*******************************/
|
1670
|
+
/* */
|
1671
|
+
/* Prime Number Functions */
|
1672
|
+
/* */
|
1673
|
+
/*******************************/
|
1674
|
+
|
1675
|
+
/* Mode values passed to a gcry_prime_check_func_t. */
|
1676
|
+
#define GCRY_PRIME_CHECK_AT_FINISH 0
|
1677
|
+
#define GCRY_PRIME_CHECK_AT_GOT_PRIME 1
|
1678
|
+
#define GCRY_PRIME_CHECK_AT_MAYBE_PRIME 2
|
1679
|
+
|
1680
|
+
/* The function should return 1 if the operation shall continue, 0 to
|
1681
|
+
reject the prime candidate. */
|
1682
|
+
typedef int (*gcry_prime_check_func_t) (void *arg, int mode,
|
1683
|
+
gcry_mpi_t candidate);
|
1684
|
+
|
1685
|
+
/* Flags for gcry_prime_generate(): */
|
1686
|
+
|
1687
|
+
/* Allocate prime numbers and factors in secure memory. */
|
1688
|
+
#define GCRY_PRIME_FLAG_SECRET (1 << 0)
|
1689
|
+
|
1690
|
+
/* Make sure that at least one prime factor is of size
|
1691
|
+
`FACTOR_BITS'. */
|
1692
|
+
#define GCRY_PRIME_FLAG_SPECIAL_FACTOR (1 << 1)
|
1693
|
+
|
1694
|
+
/* Generate a new prime number of PRIME_BITS bits and store it in
|
1695
|
+
PRIME. If FACTOR_BITS is non-zero, one of the prime factors of
|
1696
|
+
(prime - 1) / 2 must be FACTOR_BITS bits long. If FACTORS is
|
1697
|
+
non-zero, allocate a new, NULL-terminated array holding the prime
|
1698
|
+
factors and store it in FACTORS. FLAGS might be used to influence
|
1699
|
+
the prime number generation process. */
|
1700
|
+
gcry_error_t gcry_prime_generate (gcry_mpi_t *prime,
|
1701
|
+
unsigned int prime_bits,
|
1702
|
+
unsigned int factor_bits,
|
1703
|
+
gcry_mpi_t **factors,
|
1704
|
+
gcry_prime_check_func_t cb_func,
|
1705
|
+
void *cb_arg,
|
1706
|
+
gcry_random_level_t random_level,
|
1707
|
+
unsigned int flags);
|
1708
|
+
|
1709
|
+
/* Find a generator for PRIME where the factorization of (prime-1) is
|
1710
|
+
in the NULL terminated array FACTORS. Return the generator as a
|
1711
|
+
newly allocated MPI in R_G. If START_G is not NULL, use this as
|
1712
|
+
teh start for the search. */
|
1713
|
+
gcry_error_t gcry_prime_group_generator (gcry_mpi_t *r_g,
|
1714
|
+
gcry_mpi_t prime,
|
1715
|
+
gcry_mpi_t *factors,
|
1716
|
+
gcry_mpi_t start_g);
|
1717
|
+
|
1718
|
+
|
1719
|
+
/* Convenience function to release the FACTORS array. */
|
1720
|
+
void gcry_prime_release_factors (gcry_mpi_t *factors);
|
1721
|
+
|
1722
|
+
|
1723
|
+
/* Check wether the number X is prime. */
|
1724
|
+
gcry_error_t gcry_prime_check (gcry_mpi_t x, unsigned int flags);
|
1725
|
+
|
1726
|
+
|
1727
|
+
|
1728
|
+
/************************************
|
1729
|
+
* *
|
1730
|
+
* Miscellaneous Stuff *
|
1731
|
+
* *
|
1732
|
+
************************************/
|
1733
|
+
|
1734
|
+
/* Log levels used by the internal logging facility. */
|
1735
|
+
enum gcry_log_levels
|
1736
|
+
{
|
1737
|
+
GCRY_LOG_CONT = 0, /* (Continue the last log line.) */
|
1738
|
+
GCRY_LOG_INFO = 10,
|
1739
|
+
GCRY_LOG_WARN = 20,
|
1740
|
+
GCRY_LOG_ERROR = 30,
|
1741
|
+
GCRY_LOG_FATAL = 40,
|
1742
|
+
GCRY_LOG_BUG = 50,
|
1743
|
+
GCRY_LOG_DEBUG = 100
|
1744
|
+
};
|
1745
|
+
|
1746
|
+
/* Type for progress handlers. */
|
1747
|
+
typedef void (*gcry_handler_progress_t) (void *, const char *, int, int, int);
|
1748
|
+
|
1749
|
+
/* Type for memory allocation handlers. */
|
1750
|
+
typedef void *(*gcry_handler_alloc_t) (size_t n);
|
1751
|
+
|
1752
|
+
/* Type for secure memory check handlers. */
|
1753
|
+
typedef int (*gcry_handler_secure_check_t) (const void *);
|
1754
|
+
|
1755
|
+
/* Type for memory reallocation handlers. */
|
1756
|
+
typedef void *(*gcry_handler_realloc_t) (void *p, size_t n);
|
1757
|
+
|
1758
|
+
/* Type for memory free handlers. */
|
1759
|
+
typedef void (*gcry_handler_free_t) (void *);
|
1760
|
+
|
1761
|
+
/* Type for out-of-memory handlers. */
|
1762
|
+
typedef int (*gcry_handler_no_mem_t) (void *, size_t, unsigned int);
|
1763
|
+
|
1764
|
+
/* Type for fatal error handlers. */
|
1765
|
+
typedef void (*gcry_handler_error_t) (void *, int, const char *);
|
1766
|
+
|
1767
|
+
/* Type for logging handlers. */
|
1768
|
+
typedef void (*gcry_handler_log_t) (void *, int, const char *, va_list);
|
1769
|
+
|
1770
|
+
/* Certain operations can provide progress information. This function
|
1771
|
+
is used to register a handler for retrieving these information. */
|
1772
|
+
void gcry_set_progress_handler (gcry_handler_progress_t cb, void *cb_data);
|
1773
|
+
|
1774
|
+
|
1775
|
+
/* Register a custom memory allocation functions. */
|
1776
|
+
void gcry_set_allocation_handler (
|
1777
|
+
gcry_handler_alloc_t func_alloc,
|
1778
|
+
gcry_handler_alloc_t func_alloc_secure,
|
1779
|
+
gcry_handler_secure_check_t func_secure_check,
|
1780
|
+
gcry_handler_realloc_t func_realloc,
|
1781
|
+
gcry_handler_free_t func_free);
|
1782
|
+
|
1783
|
+
/* Register a function used instead of the internal out of memory
|
1784
|
+
handler. */
|
1785
|
+
void gcry_set_outofcore_handler (gcry_handler_no_mem_t h, void *opaque);
|
1786
|
+
|
1787
|
+
/* Register a function used instead of the internal fatal error
|
1788
|
+
handler. */
|
1789
|
+
void gcry_set_fatalerror_handler (gcry_handler_error_t fnc, void *opaque);
|
1790
|
+
|
1791
|
+
/* Register a function used instead of the internal logging
|
1792
|
+
facility. */
|
1793
|
+
void gcry_set_log_handler (gcry_handler_log_t f, void *opaque);
|
1794
|
+
|
1795
|
+
/* Reserved for future use. */
|
1796
|
+
void gcry_set_gettext_handler (const char *(*f)(const char*));
|
1797
|
+
|
1798
|
+
/* Libgcrypt uses its own memory allocation. It is important to use
|
1799
|
+
gcry_free () to release memory allocated by libgcrypt. */
|
1800
|
+
void *gcry_malloc (size_t n) _GCRY_GCC_ATTR_MALLOC;
|
1801
|
+
void *gcry_calloc (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC;
|
1802
|
+
void *gcry_malloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC;
|
1803
|
+
void *gcry_calloc_secure (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC;
|
1804
|
+
void *gcry_realloc (void *a, size_t n);
|
1805
|
+
char *gcry_strdup (const char *string) _GCRY_GCC_ATTR_MALLOC;
|
1806
|
+
void *gcry_xmalloc (size_t n) _GCRY_GCC_ATTR_MALLOC;
|
1807
|
+
void *gcry_xcalloc (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC;
|
1808
|
+
void *gcry_xmalloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC;
|
1809
|
+
void *gcry_xcalloc_secure (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC;
|
1810
|
+
void *gcry_xrealloc (void *a, size_t n);
|
1811
|
+
char *gcry_xstrdup (const char * a) _GCRY_GCC_ATTR_MALLOC;
|
1812
|
+
void gcry_free (void *a);
|
1813
|
+
|
1814
|
+
/* Return true if A is allocated in "secure" memory. */
|
1815
|
+
int gcry_is_secure (const void *a) _GCRY_GCC_ATTR_PURE;
|
1816
|
+
|
1817
|
+
/* Include support for Libgcrypt modules. */
|
1818
|
+
#include <gcrypt-module.h>
|
1819
|
+
|
1820
|
+
#if 0 /* (Keep Emacsens' auto-indent happy.) */
|
1821
|
+
{
|
1822
|
+
#endif
|
1823
|
+
#ifdef __cplusplus
|
1824
|
+
}
|
1825
|
+
#endif
|
1826
|
+
#endif /* _GCRYPT_H */
|