Commit 091399c
agent: size the signature buffer from the identity
- PostSignRequest() allocates the signature buffer from agent->heap,
sized from the identity's modulus mpint for RSA and from
ECDSA_ASN_SIG_SZ for ECDSA, and frees it before returning. A modulus
longer than RSA_MAX_SIZE, or a key type that sets no size, returns
WS_BUFFER_E.
- wolfSSH_AGENT_SignRequest() reads the agent's reply into a heap
buffer of WOLFSSH_AGENT_MAX_RSP_SZ, a new overridable define in
agent.c, freed after the last use of agent->msg.
- tests/api.c carries a 3072-bit RSA key and a P-521 key as hex string
components, and build_string() and build_mpint() helpers that write
the message fields. AgentTestCtx.response sizes from
AGENT_TEST_BUF_SZ.
- test_wolfSSH_agent_signrequest_rsa_3072() and
test_wolfSSH_agent_signrequest_ecc_p521() add their identity through
the agent callbacks and sign with it, then clear the stored private
exponent or point and sign again.
test_wolfSSH_agent_signrequest_rsa_too_large() adds an identity whose
modulus exceeds RSA_MAX_SIZE and expects WS_BUFFER_E.
- The comment on test_wolfSSH_agent_signrequest_oversize_rsa_key()
describes the identity that test uses.
Issue: F-105411 parent 754317b commit 091399c
2 files changed
Lines changed: 466 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
826 | 832 | | |
827 | 833 | | |
828 | 834 | | |
| 835 | + | |
829 | 836 | | |
830 | | - | |
831 | 837 | | |
832 | | - | |
| 838 | + | |
833 | 839 | | |
834 | 840 | | |
835 | 841 | | |
| |||
901 | 907 | | |
902 | 908 | | |
903 | 909 | | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
904 | 940 | | |
905 | 941 | | |
906 | 942 | | |
| |||
924 | 960 | | |
925 | 961 | | |
926 | 962 | | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
927 | 966 | | |
928 | 967 | | |
929 | 968 | | |
| |||
1814 | 1853 | | |
1815 | 1854 | | |
1816 | 1855 | | |
1817 | | - | |
| 1856 | + | |
1818 | 1857 | | |
1819 | 1858 | | |
1820 | 1859 | | |
| |||
1834 | 1873 | | |
1835 | 1874 | | |
1836 | 1875 | | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
1837 | 1883 | | |
1838 | 1884 | | |
1839 | 1885 | | |
| |||
1868 | 1914 | | |
1869 | 1915 | | |
1870 | 1916 | | |
1871 | | - | |
| 1917 | + | |
1872 | 1918 | | |
1873 | 1919 | | |
1874 | 1920 | | |
| |||
1915 | 1961 | | |
1916 | 1962 | | |
1917 | 1963 | | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
1918 | 1969 | | |
1919 | 1970 | | |
1920 | 1971 | | |
| |||
0 commit comments