Differences From Artifact [e6d26b97df]:
- File
cackey.c
— part of check-in
[a2ac84031e]
at
2010-05-17 19:37:43
on branch trunk
— Updated to support determining key size from X.509 object (untested)
Updated to set HW TOKEN flag
Updated to pad sign/decrypt message to key size (untested) (user: rkeene, size: 148161) [annotate] [blame] [check-ins using]
To Artifact [64d4505a46]:
- File cackey.c — part of check-in [66507306f5] at 2010-05-17 19:43:12 on branch trunk — Fixed issues with padding (user: rkeene, size: 148394) [annotate] [blame] [check-ins using]
︙ | |||
1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 | 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 | + | * ... * */ static ssize_t cackey_signdecrypt(struct cackey_slot *slot, struct cackey_identity *identity, unsigned char *buf, size_t buflen, unsigned char *outbuf, size_t outbuflen) { unsigned char *tmpbuf, *tmpbuf_s; unsigned char bytes_to_send, p1; cackey_ret send_ret; uint16_t respcode; size_t tmpbuflen, padlen; int free_tmpbuf = 0; int le; CACKEY_DEBUG_PRINTF("Called."); if (buflen > 255) { |
︙ | |||
1906 1907 1908 1909 1910 1911 1912 | 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 | - - + + + + + | free_tmpbuf = 1; padlen = tmpbuflen - buflen - 3; tmpbuf[0] = 0x00; tmpbuf[1] = 0x01; memset(&tmpbuf[2], 0xFF, padlen); |
︙ | |||
1943 1944 1945 1946 1947 1948 1949 | 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 | - + + + + + | bytes_to_send = 245; p1 = 0x80; } else { bytes_to_send = tmpbuflen; p1 = 0x00; } |
︙ |