Differences From Artifact [b4f2f9070a]:
- File
asn1-x509.c
— part of check-in
[ef50f6c143]
at
2010-05-20 23:45:53
on branch trunk
— Corrected unpadding
Changed label to be generated, rather than derived from card
Added support for reading the modulus and exponent from an X.509 certificate
Added additional attributes (user: rkeene, size: 9503) [annotate] [blame] [check-ins using]
To Artifact [d088e178d2]:
- File
asn1-x509.c
— part of check-in
[02f5cea2da]
at
2011-09-08 01:47:17
on branch trunk
— CACKey 0.6.2
Updated to include sha1.c, md5.c, and asn1-x509.c in the cackey.c translation unit so that these symbols never get exported and conflict with existing programs
Updated to try harder to remove and weaken symbols from shared object (user: rkeene, size: 9538) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
184 185 186 187 188 189 190 | if (outbuf) { *outbuf = x509.subject.asn1rep; } return(x509.subject.asn1rep_len); } | | | | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | if (outbuf) { *outbuf = x509.subject.asn1rep; } return(x509.subject.asn1rep_len); } static ssize_t x509_to_serial(void *x509_der_buf, size_t x509_der_buf_len, void **outbuf) { struct x509_object x509; int read_ret; read_ret = asn1_x509_read_object(x509_der_buf, x509_der_buf_len, &x509); if (read_ret != 0) { return(-1); } if (outbuf) { *outbuf = x509.serial_number.asn1rep; } return(x509.serial_number.asn1rep_len); } static ssize_t x509_to_modulus(void *x509_der_buf, size_t x509_der_buf_len, void **outbuf) { struct asn1_object null, pubkey, modulus, exponent; struct x509_object x509; int read_ret; read_ret = asn1_x509_read_object(x509_der_buf, x509_der_buf_len, &x509); if (read_ret != 0) { return(-1); |
︙ | ︙ | |||
228 229 230 231 232 233 234 | if (outbuf) { *outbuf = modulus.contents; } return(modulus.size); } | | | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | if (outbuf) { *outbuf = modulus.contents; } return(modulus.size); } static ssize_t x509_to_exponent(void *x509_der_buf, size_t x509_der_buf_len, void **outbuf) { struct asn1_object null, pubkey, modulus, exponent; struct x509_object x509; int read_ret; read_ret = asn1_x509_read_object(x509_der_buf, x509_der_buf_len, &x509); if (read_ret != 0) { return(-1); |
︙ | ︙ | |||
256 257 258 259 260 261 262 | if (outbuf) { *outbuf = exponent.contents; } return(exponent.size); } | | | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | if (outbuf) { *outbuf = exponent.contents; } return(exponent.size); } static ssize_t x509_to_keysize(void *x509_der_buf, size_t x509_der_buf_len) { struct asn1_object null, pubkey, modulus, exponent; struct x509_object x509; int read_ret; read_ret = asn1_x509_read_object(x509_der_buf, x509_der_buf_len, &x509); if (read_ret != 0) { return(-1); |
︙ | ︙ | |||
321 322 323 324 325 326 327 | } break; } return("???"); } | | | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | } break; } return("???"); } static ssize_t x509_dn_to_string(void *asn1_der_buf, size_t asn1_der_buf_len, char *outbuf, size_t outbuf_len, char *matchlabel) { struct asn1_object whole_thing, current_set, current_seq; struct asn1_object label, value; const char *label_str; ssize_t snprintf_ret, retval; char *outbuf_s; int read_ret; int offset; |
︙ | ︙ |