summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-10-20build: Update gitignore rules for new automake test suite and systemd fileupstreamGuillem Jover1-0/+4
The new automake paralell test driver (enabled by default in 1.13), creates log files to track test results and output, ignore them. Ignore also the new generated systemd service file.
2014-10-20build: Install aclocal files into an m4 directoryGuillem Jover4-0/+5
2014-10-20build: Unify and centralize plugindir default to be PKGLIBDIR/pluginsGuillem Jover3-8/+7
Unify its default value to be under PKGLIBDIR, instead of LIBDIR/near, which does not match the name of the project nor the daemon. This also fixes a discrepancy between the directory encoded in the daemon and the pkg-config file. Centralize the variable to be only set once in configure.ac.
2014-10-20build: Do not expand libdir variableGuillem Jover1-1/+3
Expanding the value when setting it causes uninitialized values to trickle into generated files like neard.pc, which ends up with stuff like libdir=NONE/lib.
2014-10-20build: Do not set default prefix to the same autoconf defaultGuillem Jover1-2/+0
2014-10-20build: Always run the unit tests regardless of the tools being builtGuillem Jover1-2/+1
These have no relation, so there's no point in making one conditional to the other.
2014-10-20build: Move unit tests from noinst_PROGRAMS to check_PROGRAMSGuillem Jover1-1/+1
This means the unit tests will only be built when running «make check», only when they will be used.
2014-10-20build: Move files from AC_OUTPUT to AC_CONFIG_FILESGuillem Jover1-1/+2
The AC_OUTPUT call with arguments is obsolete.
2014-10-20build: Use AC_LANG instead of obsolete AC_LANG_CGuillem Jover1-1/+1
2014-10-20build: Namespace local macros with NEARD_ instead of AC_ or nothingGuillem Jover2-7/+7
Do not take over the autoconf namespace, as it might stomp with macros provided in the future.
2014-10-20build: Use LT_INIT instead of AC_DISABLE_STATIC and AC_PROG_LIBTOOLGuillem Jover1-2/+1
AC_PROG_LIBTOOL is deprecated and wrongly uses the autoconf namespace, use LT_INIT instead. As we are using LT_INIT anyway we might as well pass the disable-static option directly to it instead of using the AC_DISABLE_STATIC macro, which is not deprecated right now, but uses the autoconf namespace too.
2014-10-20build: Use AS_HELP_STRING instead of obsolete AC_HELP_STRINGGuillem Jover1-15/+15
2014-10-20build: Add project mailing list to configure contact addressGuillem Jover1-1/+1
This makes the project mailing list address available to the code as the PACKAGE_BUGREPORT macro, shows the address on «configure --help», and on test suite failures.
2014-09-15gdbus: Fix match rule for NameOwnerChangedAlban Crequy1-1/+2
When subscribing to the D-Bus signal NameOwnerChanged from the bus driver, specify the object path and the sender in the match rule. Otherwise, random connections on the bus could impersonate the bus driver.
2014-09-08gdbus: Fix crash when watch is toggled or disconnectedLuiz Augusto von Dentz1-2/+8
This partially reverts 510b32b7156625b9df737c916b7a7a5c6fb285b9 since it still necessary to take a reference before calling dbus_watch_handle since internally it can call watch_info_free as in the following trace: Invalid read of size 8 at 0x121085: watch_func (mainloop.c:105) by 0x4C72694: g_main_context_dispatch (gmain.c:2539) by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146) by 0x4C72DC1: g_main_loop_run (gmain.c:3340) by 0x120541: main (main.c:551) Address 0x5bbcd90 is 16 bytes inside a block of size 24 free'd at 0x4A079AE: free (vg_replace_malloc.c:427) by 0x4C7837E: g_free (gmem.c:252) by 0x4F708BF: dbus_watch_set_data (dbus-watch.c:614) by 0x4F70938: _dbus_watch_unref (dbus-watch.c:132) by 0x4F6E9A7: _dbus_transport_handle_watch (dbus-transport.c:884) by 0x4F59AFB: _dbus_connection_handle_watch (dbus-connection.c:1497) by 0x4F70AF9: dbus_watch_handle (dbus-watch.c:683) by 0x121084: watch_func (mainloop.c:103) by 0x4C72694: g_main_context_dispatch (gmain.c:2539) by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146) by 0x4C72DC1: g_main_loop_run (gmain.c:3340) by 0x120541: main (main.c:551)
2014-09-08gdbus: Fix crash when calling g_dbus_add_service_watchLuiz Augusto von Dentz1-1/+0
If g_dbus_add_service_watch is called for service which bus name is already known the following crash can happen: invalid read of size 1 at 0x4C2A2F2: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4E97722: g_strdup (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x405B0C: update_name_cache (watch.c:435) by 0x405C37: update_service (watch.c:593) by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4038EA: client_ready (test-gdbus-client.c:1014) by 0x4E9E5E0: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E9E7A5: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E9EB1A: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x403614: main (test-gdbus-client.c:1058) Address 0x5dbe5d0 is 0 bytes inside a block of size 7 free'd at 0x4C28577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4E7FF7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x405B04: update_name_cache (watch.c:434) by 0x405C37: update_service (watch.c:593) by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4038EA: client_ready (test-gdbus-client.c:1014) by 0x4E9E5E0: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E9E7A5: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E9EB1A: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x403614: main (test-gdbus-client.c:1058)
2014-09-08Revert "gdbus: Don't include just added interfaces in GetManagedObjects"Luiz Augusto von Dentz1-7/+1
This actually creates a problem since the code now does flush any pending message on the queue any signal will be send right away before the actual reply to GetManagedObjects which will not contain those interfaces.
2014-09-08gdbus: Fix use after freeAndrei Emeltchenko1-3/+8
Refactor filter_data_remove_callback so that we do not iterate over freed pointer.
2014-09-08gdbus: Avoid reporting GDBusClient disconnect twiceClaudio Takahasi1-2/+12
No matter if disconnection was reported previously, g_dbus_client_unref() was always calling service disconnect callback. This patch fix the following scenario: 1) service disconnects from the bus 2) disconnect callback gets called 3) client calls g_dbus_client_unref(), disconnect callback is called again.
2014-08-18adapter: Retry constant polling for busy AdapterAndreas Bender1-2/+11
In the current implementation, with ConstantPoll enabled, neard will retry to poll if a DEP link gets down. This may fail, if the Adapter is still busy in that very moment. If this happens the polling will fail with EBUSY and ConstantPoll functionality expires. With this patch neard checks if the Adapter was busy when the first start polling attempt was made, and will retry polling later. Signed-off-by: Andreas Bender <andreas.bender@hertz.st>
2014-08-18adapter: Prioritize p2p when discovering multiple targetsVincent Cuissard3-44/+113
In NCI it is possible for the NFCC to discover multiple targets. In that case the kernel part will send a netlink event for each of them before sending an end of list one. In the current implementation the connection to the target is done before the target done event. So the first discovered target was the one that neard tries to connect to. This patch fixes that by enabling p2p targets before tags or SEs ones. We probably want to connect to NFC-DEP (usualy having NFC-DEP and ISO-DEP on the same device means that ISO-DEP is the secure element interface).
2014-08-18AUTHORS: Mention Vincent's contributionsSamuel Ortiz1-0/+1
2014-08-18nfctype5: Support 16 bits block numbers encodingVincent Cuissard1-1/+7
In ISO15693, it is possible for tags that have huge memory to encode the number of blocks on 16bits instead of 8bits. This has to be taken into account when GET_SYSTEM_INFO is received.
2014-08-18nfctype5: RMB supportVincent Cuissard1-30/+88
Add support of READ_MULTIPLE_BLOCKS for a faster tag reading procedure. We fall back to READ_SINGLE_BLOCK if it is not supported by the tag. Tested on RMB supported tags and with an emulation of a tag that do not support RMB.
2014-08-18nfctype4: Fix tag reading procedure for DESFire V1Vincent Cuissard1-5/+19
On NXP DESFire tag V1, the SELECT FILEID right after the SELECT APPNAME has to use P1 = 0 and P2 = 0 (instead of P1 = 0 and P2 = 0x0C).
2014-08-18nfctype1: Improve the check_presence hookVincent Cuissard1-1/+1
No need to read the whole thing, getting the ID back is enough.
2014-08-18nfctype1: Fix dynamic tag readVincent Cuissard1-21/+142
The current implementation does not handle type1 dynamic tag reads correctly, the dynamic command size format is different as the data field is 8 bytes long (As opposed to 1 byte for the static commands). Also, lock and reserved TLVs are not parsed so when several commands are needed to retrieve all chunks of memory, lock and reserved area are also copied, building a corrupted NDEF. This is fixed by skipping all those areas when copying the NDEF over.
2014-06-30Makefile: add missing binaries to dependency on local_headersRoss Burton1-1/+8
seeld and snep_send were missing from the rule that generates the header symlink farm, resulting in headers not being available in highly parallel builds.
2014-06-30neard.service.in: set ExecStart correctly, remove NotifyAccessRoss Burton2-3/+2
ExecStart was evaluating to ${libexecdir}/neard, but the binary is installed to ${pkglibexecdir}/neard. Change the subsitition to reflect the actual paths. Also remove NotifyAccess, it's only used when Type=notify.
2014-05-21doc: Add seeld D-Bus APISamuel Ortiz3-1/+129
They need to be converted to freedesktop's Object Manager API. Once that's done, se-manager-api.txt will go away.
2014-05-21AUTHORS: Mention Arron's contributionsSamuel Ortiz1-0/+1
2014-05-21ace: Add length option for get refresh tag operationArron Wang2-4/+7
In command INS_GET_GP_DATA, when try to get the refresh tag value, the return value is not null, then we need to set the resp_lenght to 0. Also the response value for get refresh tag operation is (tag, length, value), we missed the length option in current code.
2014-05-21se: Add ace rule after we finished get SE operationArron Wang3-6/+7
Currently, after we get the first SE(embedded type) from kernel through netlink, we will try to get the ace rule directly, but we may failed to get through netlink with error, then the next SE type will not able to be added.
2014-05-21se: Use callback function to handle the request dataArron Wang3-22/+11
Due to we use queue to save the command, the callback function will handle the error operation, else it may lead to buffer double free. Move the free operation of req->apdu to io_cb since the io_cb function may be called directly in the plugin, after req struct is freed, req->apdu will be a wild pointer.
2014-05-21se: Fix APDU double free when transceive failsArron Wang3-12/+8
The APDU command will be freed in send_io even when transceive fails.
2014-05-21se: Fix close channel errorArron Wang1-5/+3
in close_channel_cb, return value 0 means the success operation when channel path is removed in hash table, __seel_channel_remove will be called by se_channel_free.
2014-05-21tizen: Invoke user callback when have error before transceiveArron Wang1-10/+23
Because we use the queue to save the io request, we need to use the callback function to free the request structure.
2014-05-21tizen: Use modem path as the key for modem_hashArron Wang1-9/+12
We only get the modem name from the telephony GetModems interface, but in sim_changed signal, we get the dbus path, this patch will make them in accordance with each other.
2014-05-21tizen: Change plugin name to tizenArron Wang1-1/+1
2014-05-21build: Enable seeld buildSamuel Ortiz4-7/+93
2014-05-21plugin: Include relative builtin.hSamuel Ortiz1-1/+1
neard and seeld have their own, different, dynamically generated builtin header.
2014-05-21dbus: Define neard's Secure element D-Bus interfaceSamuel Ortiz1-0/+11
2014-05-21se: Initial commitSamuel Ortiz16-0/+4320
seeld is a secure element daemon, providing a D-Bus interface for secure elements and their channels. It also implements an access control enforcer (ACE) as specified by the Global Platform.
2014-04-07ISO14443-B: Add support for ISO/IEC 14443-B ProtocolMark A. Greer3-2/+7
Add support for the ISO/IEC 14443-B protocol used by Type 4B tags.
2014-04-07nfctype4: check_presence should select NDEF fileMark A. Greer1-2/+12
The nfctype4_check_presence() routine should select the NDEF file instead of the NDEF Tag Application otherwise write operations may fail. To accomplish this, store the the NDEF file ID in the tag structure and use it when issuing the 'Select' command thats a part of the check presence process.
2014-04-07tag: Type 4: Extend tag structure to store Type 4 file IDMark A. Greer2-0/+19
Extend the Type 4 tag-specific section of the tag structure to hold the File ID from the 'NDEF File Control TLV' portion of the Capability Container file. Also provide accessor functions to get & set the its value.
2014-04-07nfctype4: Use correct P2 value for 'Select' commandsMark A. Greer1-1/+7
The current implementation of the ISO_Select() routine always sets the P2 value for the 'Select' command to 0. However, according the the NFC Forum, Type 4 Tag Operation Specification, the value of P2 depends on what is being selected. The proper values from the specification are shown below. Target of Selection P1 P2 Spec Reference ------------------- -- -- -------------- NDEF Tag Application 0x04 0x00 Table 10 Capability Container 0x00 0x0C Table 13 NDEF File 0x00 0x0C Table 19 So, when P1 is 0x04, P2 is 0x00 and when P1 is 0x00, P2 is 0x0C. Add this logic to the ISO_Select() routine so the proper value for P2 is always used.
2014-04-07nfctype4: Handle NDEF file larger than Max R-APDU Data Size"Mark A. Greer1-1/+6
The current t4_readbin_NDEF_ID() implementation assumes that the NDEF file length is less than or equal to the Max R-APDU Data Size. This may not alway be true so be sure to read the lesser of the two values. data_read_cb() will continue to read the rest of the data when the NDEF file length is larger than the Max R-APDU Data Size.
2014-04-07nfctype4: Read the proper number of byte of the NDEF fileMark A. Greer1-3/+5
When reading the NDEF file from the tag, the t4_readbin_NDEF_ID() routine reads "Max R-APDU Data Size" bytes instead of the number of bytes in the NDEF file. Fix this by reading the number of bytes in the NDEF file which is available in the response data passed into t4_readbin_NDEF_ID().
2014-04-07nfctype4: Clean up parenthesis usageMark A. Greer1-3/+3
Clean up some parenthesis usage which won't change the order of evaluation but makes it clearer to the reader.