Files
AnyPS5/docs/dev/debt/changes/fix-libressl-ec-error-queue.md

4.2 KiB

libSceLibreSsl

add Unknown function info

  • EC error queue (libSceLibreSsl) - no console check. The EC, ECDSA and ECDH exports queue the reason codes of LibreSSL 2.5.4 ec_key.c, ec_curve.c, ecp_oct.c, ecs_ossl.c and ech_key.c for the failures this port returns. Not queued: the ASN.1 errors of a signature that does not decode; allocation, BN and arithmetic failures, which throw; EC_POINT_new and EC_POINT_oct2point; a peer point at infinity of another curve in ECDH_compute_key. LibreSSL built without OPENSSL_BN_ASM_MONT clears the queue when EC_GROUP_new_by_curve_name loads a non-NIST prime; the port keeps it. libSceLibreSsl3 forwards these exports, so its callers get the 2.5.4 ERR_LIB_ECDSA and ERR_LIB_ECDH codes where 4.0.0 queues ERR_LIB_EC ones

change [EC_GROUP_new_by_curve_name, EC_GROUP_free, EC_GROUP_get_degree, EC_KEY_new, EC_KEY_new_by_curve_name, EC_KEY_free, EC_KEY_set_group, EC_KEY_get0_group, ECDSA_size]

change [EC_POINT_new, EC_POINT_free, EC_POINT_point2oct, EC_POINT_oct2point, EC_KEY_generate_key, EC_KEY_check_key, EC_KEY_get0_public_key, EC_KEY_set_public_key, ECDSA_sign, ECDSA_verify, ECDH_compute_key]

change [EC_POINT_mul]

  • EC_POINT_mul (libSceLibreSsl) - not checked on the console. It follows LibreSSL 2.5.4's ec_lib.c and ec_mult.c on the curves above: the result is a scalar times the generator plus a scalar times the point, a term without its scalar or point is left out, and with neither the result is at infinity. Scalars are taken modulo the group order, which gives LibreSSL's points for negative scalars and scalars above the order, since every point on these curves has that order. A point off the curve throws, where LibreSSL computes with it; a point of another curve throws as above. No error code is queued: the ones LibreSSL has here are for points of another method and for internal failures