aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gpg,sm: Set confidential in assuan communication for password.NIIBE Yutaka2023-11-102-0/+4
| | | | | | | | | | | | | | * g10/call-agent.c (default_inq_cb): Call assuan_begin_confidential and assuan_end_confidential. * sm/call-agent.c (default_inq_cb): Likewise. -- Cherry pick from master commit of: ec1446f9446506b5fbdf90cdeb9cbe1f410a657e GnuPG-bug-id: 6654 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgsm: Support ECDSA in de-vs mode.Werner Koch2023-11-086-6/+18
| | | | | | | | | | | * common/compliance.h (PK_ALGO_FLAG_ECC18): New. * common/compliance.c (gnupg_pk_is_allowed): Implement. * sm/decrypt.c (gpgsm_decrypt): Pass new flag. * sm/sign.c (gpgsm_sign): Ditto. * sm/verify.c (gpgsm_verify): Ditto. -- GnuPG-bug-id: 6802
* gpgsm: Cleanup of legacy variable name use.Werner Koch2023-11-082-117/+89
| | | | | | | | | | * sm/encrypt.c (gpgsm_encrypt): Unify use of RC and ERR. * sm/sign.c (gpgsm_sign): ditto. -- Initially we didn't used the gpg_error_t thingy and while migrating we sometimes used RC and ERR for tracking the error. This is pretty error prone and thus we better remove it (after 20 years).
* scd:openpgp: Fix a segv for cards supporting unknown curves.Werner Koch2023-11-071-2/+2
| | | | | | | | | | * common/openpgp-oid.c (get_keyalgo_string): Do not strdup NULL. -- Cherry pick 2.4/master commit of: 385f4841330e277949ddf2f13939b97481d2d29c GnuPG-bug-id: 5963
* w32: Use utf8 for the asctimestamp function.Werner Koch2023-10-272-1/+6
| | | | | | | | * common/gettime.c (asctimestamp) [W32]: Use ".UTF8" for the locale. -- This has been suggested by the reporter of GnuPG-bug-id: 6741
* gpg: Pass ECDH parameters to OpenPGP smartcardsWerner Koch2023-10-276-11/+68
| | | | | | | | | | | | | | * g10/call-agent.c (agent_keytocard): Add arg ecdh_param_str. * g10/keyid.c (ecdh_param_str_from_pk): New. * g10/card-util.c (card_store_subkey): Pass ECDH params to writekey. * g10/keygen.c (card_store_key_with_backup): Ditto. -- Backported from 2.4 - here the gpg part. See-commit: c03ba92576e34f791430ab1c68814ff16c81407b This is related to GnuPG-bug-id: 6378
* agent: Add optional ecdh parameter arg to KEYTOCARD.Werner Koch2023-10-275-71/+127
| | | | | | | | | | | | | | | | | | | | | * agent/command.c (KEYTOCARD_TIMESTAMP_FORMAT): Remove and use format string direct. (cmd_keytocard): Change timestamp to an u64 and use the new u64 parser functions. Use split_fields. Add ecdh parameter stuff. Take the default timestamp from the keyfile. * agent/findkey.c (agent_key_from_file): Add arg timestamp and set it. Adjust all callers. -- This is backport from 2.4 but only the agent part. We consider it more relibale if we also pass the ECDH parameters along in 2.2. Adding the timestamp stuff should not harm either. Because we now have the u64 time string parser, we use them here. See-commit: c03ba92576e34f791430ab1c68814ff16c81407b See-commit: c795be79c14fac01b984bdc2e2041d2141f27612 This patch is somewhat related to: GnuPG-bug-id: 6378, 5538
* gpg: Allow expiration time after 2013-01-19 on 32 bit Windows.Werner Koch2023-10-261-7/+18
| | | | | | | | * g10/keygen.c (parse_expire_string): Use isotime2epoch_u64. (parse_creation_string): Ditto. -- GnuPG-bug-id: 6736
* common: New functions timegm_u64, isotime2epoch_u64.Werner Koch2023-10-264-154/+176
| | | | | | | | | | | | | | | | | | | * common/mischelp.c (timegm): Move to ... * common/gettime.c (timegm): here. On Windows use timegm_u32. (timegm_u32): New. (isotime2epoch): Factor code out to ... (isotime_make_tm): new helper. (isotime2epoch_u64): New. (_win32_timegm): Remove duplicated code. (parse_timestamp): Use of timegm. (scan_isodatestr): Fallback to isotime2epoch_u64. -- This mainly helps on 32 bit Windows. For Unix we assume everyone is using 64 bit or shall wait until the libc hackers finally provide a time64_t. GnuPG-bug-id: 6736
* build: Add mising file for make distcheck.Werner Koch2023-10-251-0/+1
| | | | 00
* Add new NEWS itemsWerner Koch2023-10-251-0/+5
| | | | --
* sm: Flag Brainpool curves as compliant for all other operations.Werner Koch2023-10-247-23/+25
| | | | | | | | | | | | | | * sm/fingerprint.c (gpgsm_get_key_algo_info2): Rename to (gpgsm_get_key_algo_info): this. Remove the old wrapper. Adjust all callers. * sm/decrypt.c (gpgsm_decrypt): Pass the curve to the compliance checker. * sm/encrypt.c (gpgsm_encrypt): Ditto. * sm/sign.c (gpgsm_sign): Ditto. * sm/verify.c (gpgsm_verify): Ditto. -- GnuPG-bug-id: 6253
* sm: Flag Brainpool curves as compliant.Werner Koch2023-10-241-3/+3
| | | | | | | | * sm/keylist.c (print_compliance_flags): Add arg curve. (list_cert_colon): Pass curve to the compliance check. -- GnuPG-bug-id: 6253
* sm: Another partly rewrite of minip12.cWerner Koch2023-10-243-180/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/minip12.c (struct tlv_ctx_s): Add origbuffer and origbufsize. Remove pop_count. Rename offset to length. (dump_tag_info, _dump_tag_info): Rewrite. (dump_tlv_ctx, _dump_tlv_ctx): Rewrite. (tlv_new): Init origbuffer. (_tlv_peek): Add arg ti. (tlv_peek): New. (tlv_peek_null): New. (_tlv_push): Rewrite. (_tlv_pop): Rewrite. (tlv_next): New macro. Move old code to ... (_tlv_next): this. Add arg lno. Pop remaining end tags. (tlv_popped): Remove. (tlv_expect_object): Handle ndef. (tlv_expect_octet_string): Ditto. (parse_bag_encrypted_data): Use nesting level to control the inner loop. (parse_shrouded_key_bag): Likewise. (parse_bag_data): Handle surplus octet strings. (p12_parse): Ditto. * sm/minip12.c (decrypt_block): Strip the padding. (tlv_expect_top_sequence): Remove. Replace callers by tlv_expect_sequence. * tests/samplekeys/t6752-ov-user-ff.p12: New sample key. * tests/samplekeys/Description-p12: Add its description -- This patch improves the BER parser by simplifying it. Now tlv_next pops off and thus closes all containers regardless on whether they are length bounded or ndef. tlv_set_pending is now always used to undo the effect of a tlv_next in a loop condition which was terminated by a nesting level change. Instead of using the length as seen in the decrypted container we now remove the padding and let the BER parser do its work. This might have a negative effect on pkcs#12 objects which are not correctly padded but we don't have any example of such broken objects. GnuPG-bug-id: 6752
* sm: Minor robustness fix for a regression test.Werner Koch2023-10-171-1/+4
| | | | | | | | | * sm/t-minip12.c (run_one_test): Don't hash if we have no parameters at all. -- This fix handles the case that an empty result array is returned by minip12.c
* sm: Support import of PKCS#12 encoded ECC private keys.Werner Koch2023-10-171-31/+76
| | | | | | | | | | | * sm/import.c (parse_p12): Support ECC import. -- Although I extended the parser and its test the actual import missed the required code. GnuPG-bug-id: 6253 Backported-from-master: 8dfef5197af9f655697e0095c6613137d51c91e7
* build: Extend autobuild diagnostics by the usernameWerner Koch2023-10-161-0/+3
| | | | | | | | | * m4/autobuild.m4 (AB_INIT): Add username. -- The old autobuild diagnostics show up in build logs. What they are missing is an information on the user who triggered a build. EMAIL is a common thing to denote the actual user using a service account.
* gpg: Allow to specify seconds since Epoch beyond 2038.Werner Koch2023-10-141-3/+10
| | | | | | | | | | | * g10/keygen.c (parse_expire_string_with_ct): Use new function scan_secondsstr. (parse_creation_string): Ditto. -- Noet that we cap the seconds at the year 2106. GnuPG-bug-id: 6736
* common: New function scan_secondsstr.Werner Koch2023-10-144-2/+76
| | | | | | | * common/gettime.c (scan_secondsstr): New. * common/t-gettime.c (test_scan_secondsstr): (main): Call it.
* scd:openpgp: Use a special compare for the serialno.Werner Koch2023-10-111-2/+9
| | | | | | | | | | | | | | * scd/app-openpgp.c (check_keyidstr): Ignore the card version and also compare case insensitive. (do_learn_status): Add mssing error handling. -- This is required because we changed what we emit as serialno of OpenPGP cards but existing keys still use the old form of the serial number (i.e. with a firmware version). This is so that existing stub keys of gpg-agent will continue to work. GnuPG-bug-id: 5100
* scd:openpgp: Allow the reading the key by keygrip.Werner Koch2023-10-111-4/+39
| | | | | | | | | * scd/app-openpgp.c (do_readkey): Allow the keygrip for the keyid. Use case insensitive match forthe keyid. (do_readcert): Allow the keygrip for the keyid. -- This patch is only to sync ths up with master.
* scd:openpgp: Extend KEYPAIRINFO with an algorithm string.Werner Koch2023-10-111-7/+56
| | | | | | | | * scd/app-openpgp.c (retrieve_fprtime_from_card): New. (send_keypair_info): Add more to KEYPAIRINFO. -- This is mainly needed to sync this version with master.
* scd:openpgp: Use shared fucntion for the dispserialno.Werner Koch2023-10-111-32/+46
| | | | | | | | | | | | | * scd/app-openpgp.c (wipe_and_free): New. (wipe_and_free_string): New. (get_disp_serialno): Remove. Replace callers by function app_get_dispserialno. (get_usage_string): New. (send_keypair_info): Use new function. -- The new function has the same behaviour. The wipe functions are not yet used.
* scd:openpgp: Some comment updatesWerner Koch2023-10-101-18/+29
| | | | --
* scd: Add handling of "Algorithm Information" DO.NIIBE Yutaka2023-10-101-0/+1
| | | | | | | | | | | | | | * cd/app-openpgp.c (data_objects): Add 0x00FA. (do_getattr): Add KEY-ATTR-INFO. -- See the section 4.4.3.11 Algorithm Information in the OpenPGP card functional specification version 3.4.1. Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 90d0072165cc5c6888f14462392a211de0c4b232) Some parts where already here.
* scd:openpgp: New KEY-STATUS attribute.Werner Koch2023-10-101-1/+2
| | | | | | | | * scd/app-openpgp.c (do_getattr): Return KEY-STATUS -- (cherry picked from commit 21496761226c1020a98e3ec7dd2b9dd013d4386b) Some things from the original commit where already here.
* scd:openpgp: Add attribute "UIF" for convenience.Werner Koch2023-10-101-7/+13
| | | | | | | | | | | | | * scd/app-openpgp.c (do_getattr): New attrubute "UIF". (do_learn_status): Use that. -- Actually this is not just convenience but will make it easier to add new keys to an openpgp card - we will need to change this only at one place. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 11f0700282c1eeaee8db6686c38aca0900271351)
* scd: Add handling of Ed448 key.NIIBE Yutaka2023-10-101-13/+12
| | | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (struct app_local_s): Add ecc.algo field. (send_key_attr): Use ecc.algo field. (ecc_read_pubkey): Use ecc.algo field. (ecc_writekey): Ed448 means EdDSA. (parse_algorithm_attribute): Set ecc.algo field from card. Add checking for Ed25519 for ECC_FLAG_DJB_TWEAK flag. -- There used to be a possible support of Ed25519 with ECDSA, (instead of EdDSA). To distinguish key for Ed25519 for EdDSA, we use the flag: (flags eddsa). Ed448 has no support for ECDSA and defaults to EdDSA even if no such flag. Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit b743942a9719be59f1da67cd338248fe7ee5aeab)
* scd:openpgp: Support the ecdh-params arg for writing keys.Werner Koch2023-10-101-20/+72
| | | | | | | | | | | | | | | | | * scd/app-openpgp.c (ecc_writekey): Use provided ECDH params to compute the fingerprint. Add a default for use by gnupg 2.2. (store_fpr): Add arg update. (rsa_read_pubkey, ecc_read_pubkey): Add arg meta_update and avoid writing the fingerprint back to the card if not set. (read_public_key): Also add arg meta_update. (get_public_key): Do not pass it as true here... (do_genkey): ... but here. -- This is based on commit c03ba92576e34f791430ab1c68814ff16c81407b and done here to ease backporting. There is no functional change. GnuPG-bug-id: 6378
* scd:openpgp: Handle wrong error return code of Yubikey.Werner Koch2023-10-101-5/+6
| | | | | | | | | | * scd/app-openpgp.c (get_public_key): Handle wrong error code by Yubikeys. -- This has been taken from commits 0db9c83555b4a8a0c52f96e96ec20dbfd3d75272 946555ea3ceb823b95ed13654ae4fd667daa4337
* scd: Fix description string.NIIBE Yutaka2023-10-101-2/+2
| | | | | | | * scd/app-openpgp.c (data_objects): Capitalize the word for usage. Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit e6b7e0ff9990813ac9f11b2d9d92596d6379ebfe)
* scd:openpgp: Support UIF changing command.NIIBE Yutaka2023-10-101-4/+22
| | | | | | | | | | | | | | | | | | | * g10/card-util.c (uif, cmdUIF): New. (card_edit): Add call to uif by cmdUIF. * scd/app-openpgp.c (do_getattr): Support UIF-1, UIF-2, and UIF-3. (do_setattr): Likewise. (do_learn_status): Learn UIF-1, UIF-2, and UIF-3. -- GnuPG-bug-id: 4158 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 0cb65564e022fface5ada4de8e0c2c4c3d0ac8ad) Also included the relevant part from commit 0240345728a84d8f235ce05889e83963e52742eb Note that this patch is mainly to simplifying backporting and not to support the UIF.
* scd:openpgp: Small speedup reading card properties.Werner Koch2023-10-101-2/+19
| | | | | | | | | | | | | | | | | * scd/app-openpgp.c (struct app_local_s): Add new flag. (get_cached_data): Force chace use if flag is set. (app_select_openpgp): Avoid reading DO 6E multiple times. -- The do not cache property of 6E was introduced so that we can change for example key attributes without getting into with the cache. However, for initial reading the cache makes a lot of sense and thus we now use this hack to only temporary cache. A better strategy would be to clear the cache when we change card data but that is more error prone. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit d5fb5983232cf4d60cf6aa00d0ae5a16cf948e19)
* scd:openpgp: Allow reading and writing user certs for keys 1 and 2Werner Koch2023-10-103-22/+127
| | | | | | | | | | | | | | | * scd/iso7816.c (CMD_SELECT_DATA): New. (iso7816_select_data): New. * scd/app-openpgp.c (do_readcert): Allow OpenPGP.1 and OPENPGP.2 (do_writecert): Ditto. (do_setattr): Add CERT-1 and CERT-2. -- This has been tested with a Zeitcontrol 3.4 card. A test with a Yubikey 5 (firmware 5.2.6) claiming to support 3.4 failed. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 37b1c5c2004c1147a13b388863aaa8f0caf7d71f)
* scd: Allow standard keyref scheme for app-openpgp.Werner Koch2023-10-101-0/+11
| | | | | | | | | | | | | | * scd/app-openpgp.c (do_change_pin): Allow prefixing the CHVNO with "OPENPGP." -- The generic keyref allows for better error detection in case a keyref is send to a wrong card. This has been taken from master commit 3231ecdafd71ac47b734469b07170756979ede72 which has additional changed for gpg-card-tool, which is only available there. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 6651a0640d0f1b4dd161210dc55974d9b93b7253)
* scd:openpgp: Support GET DATA response with no header for DO 0x00FA.NIIBE Yutaka2023-10-101-2/+2
| | | | | | | | * scd/app-openpgp.c (do_getattr): Support Gnuk, as well. -- Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 43bbc25b0f57dec24412886ff46041e0b1f3de26)
* scd:openpgp: Pass arg ctrl to more functions.Werner Koch2023-10-101-50/+49
| | | | | | | | | | | | | | | * scd/app-openpgp.c (verify_a_chv): Add currently unused arg ctrl. Adjust callers. (verify_chv3): Ditto. (verify_chv2): Add arg ctrl. Adjust callers. (change_keyattr): Ditto. (change_rsa_keyattr): Ditto. (change_keyattr_from_string): Ditto. (rsa_writekey): Ditto. (ecc_writekey): Ditto. -- This helps in backporting from master.
* scd:openpgp: Replace assert by log_assert.Werner Koch2023-10-101-17/+17
| | | | | * scd/app-openpgp.c: Remope assert.h. Replace all assert by log_assert.
* scd:openpgp: Fix computing fingerprint for ECC with SOS.NIIBE Yutaka2023-10-101-1/+22
| | | | | | | | | | | * scd/app-openpgp.c (count_sos_bits): New. Count as sos_write does. (store_fpr): For ECC, use count_sos_bits. -- Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 95156ef9bfb6a3a525454d50ae2f5b538ccbd774) and (cherry picked from commit f482e4bd121ff2862bfb53a82f1d5c2cf3524a10)
* scd:openpgp: Very minor refactoringWerner Koch2023-10-101-3/+5
| | | | | * scd/app-openpgp.c (app_select_openpgp): Move AID definition to ... (openpgp_aid): new.
* scd:openpgp: Rename an internal variable.Werner Koch2023-10-101-13/+14
| | | | | | | | | | | | | | | * scd/app-openpgp.c (struct app_local_s): s/extcap_v3/is_v3/. s/max_certlen_3/max_certlen. Change users. -- The extcap_v3 flag is set if the version is 3 or later and as such does not only declare that the v3 extcap layout is used. Make this clear by renaming. Likewise for max_certlen_3. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit bbdb48ec0ddd99ce23fcba42949c00a2594fb9a5)
* sm: Support more HMAC algos in the pkcs#12 parser.Werner Koch2023-10-065-15/+135
| | | | | | | | | | | | | | | | | | | | | | | | * sm/minip12.c (oid_hmacWithSHA1): New. Also for the SHA-2 algos. (digest_algo_from_oid): New. (set_key_iv_pbes2): Add arg digest_algo. (crypt_block): Ditto. (decrypt_block): Ditto. (parse_bag_encrypted_data): Parse the optional prf part and get the hmac algorithm. (parse_shrouded_key_bag): Ditto. (p12_build): Pass SHA1 for digest_algo. * sm/t-minip12.c (run_one_test): Print failed values in verbose mode. * tests/samplekeys/nistp256-openssl-self-signed.p12: New. * tests/samplekeys/Description-p12: Add this one. * tests/Makefile.am (EXTRA_DIST): Ditto. -- This supports the modern algorithms, i.e. using SHA256 for the KDF which is the default in openssl unless the -legacy option is used. GnuPG-bug-id: 6536
* common,w32: Add missing GetLastError->errno mapping.Werner Koch2023-10-053-6/+9
| | | | | | | | | | * common/iobuf.c (file_filter, sock_filter): Add missing mapping. -- GnuPG-bug-id: 6528 (cherry picked from commit 5e94470d053ec93f79acb03635e67839a5a1e6a8) Also includes commit a3be97df4ddfce008dcc6e877e9fb98c71656ec6
* sm: Improve the octet string cramming for pkcs#12Werner Koch2023-10-054-17/+73
| | | | | | | | | | | | | | | | | | | * sm/minip12.c (need_octet_string_cramming): New. (tlv_expect_object, tlv_expect_octet_string): Run the test before cramming. * sm/minip12.c (ENABLE_DER_STRUCT_DUMPING): New but undefined macro for debug purposes. (bag_decrypted_data_p, bag_data_p): Use macro to allow dumping. -- This bug was exhibited by importing a gpgsm exported EC certificate. We use an extra test instead of retrying to allow retruning an error from malloc failure. And well, for easier reading of the code. GnuPG-bug-id: 6536 (cherry picked from commit c1f78634ec3927ddcfdc4687bc6e408c658a0ece)
* Update NEWSWerner Koch2023-10-021-1/+12
| | | | --
* common: Improve lock strategy for dotlock.Werner Koch2023-10-021-40/+46
| | | | | | | | | | | | | | | | | | | | | | | | | * common/dotlock.c (next_wait_interval): New. (dotlock_take_unix): Use new function. (dotlock_take_w32): Ditto. -- In particular when using a dotlock file for protecting the spawning and several processes try to spawn the agent or another component, we often run into long delays. The solution is to is to exponential backoff and also to reduce the initial delay from 50ms to 4ms. We further limit the maximum wait period to about 2 seconds and then repeat at intervals of 512, 1024 and 2048ms. In the wait-forever case we add a small random value to have different intervals per process. GnuPG-bug-id: 3380 For testing this code snippet in the spawning function might be useful: const char *s; if ((s=getenv("hold_gpg_file"))) while (!gnupg_access (s, F_OK)) gnupg_sleep (1);
* dirmngr: Add code to support the negotiation auth method.Werner Koch2023-10-022-34/+369
| | | | | | | | | | | | | | | | | | | | * dirmngr/http.c (enum auth_negotiate_states): New. (struct proxy_info_s): Add new fields. (release_proxy_info): Free Windows stuff. (proxy_get_token): New. Implemented only for Windows for now. (run_proxy_connect): Add support for auth method Negotiation. (store_header): Keep some header lines separate. -- The code does something but I have not yet been able to test it due to problems setting up Squid with AD authentication. As of now it will respond with a failure but that should not be worse than not to implement Negotiation. Supporting Negotiation using GSS for Unix should eventually also be done. GnuPG-bug-id: 6719
* dirmngr: Extended the http_get_header function.Werner Koch2023-10-026-14/+23
| | | | | | | * dirmngr/http.c (send_request): Add arg 'skip'. Adjust all callers. -- GnuPG-bug-id: 6719
* common: Add new function b64decode.Werner Koch2023-09-295-18/+168
| | | | | | | | | | | | | | | | | | * common/b64dec.c (b64decode): New. * common/t-b64.c: Change license to LGPL. (oops): New macro. (hex2buffer): New. (test_b64decode): New. (main): Default to run the new test. * common/Makefile.am (module_maint_tests): Move t-b64 to ... (module_tests): here. -- Sometimes we have a short base64 encoded string we need todecode. This function makes it simpler. License change of the test module justified because I am the single author of the code.
* dirmngr: Fix handling of the HTTP Content-LengthWerner Koch2023-09-261-15/+139
| | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/http.c (cookie_s): Add fields pending, up_to_empty_line, last_was_lf, and last_was_lfcr. (http_context_s): Add field keep-alive. (http_wait_response): Set up_to_empty_line. Take care of keep_alive flag. (coookie_read): Implement detection of empty lines. (cookie_write): Free the pending buffer. -- The problem we fix here is that we already buffered stuff beyond the empty line which marks the start of the content-length counting. Thus we tried to wait for more bytes despite that everything had already been read. This bug might have showed up more often in the real world since the we changed the BUFSIZ on Windows from 512 byte to 8k. It also depends on the length of the headers and whether the server closed the connection so that we ignored the Content-Length. The bug was introduced earlier than 2010 and could have the effect that a connection got stuck until the network layer timed out. Note that the keep-alive parts of the patch are not yet used.