… | |
… | |
132 | rsa_hash (const rsaid &id, const rsachallenge &chg, rsaresponse &h) |
132 | rsa_hash (const rsaid &id, const rsachallenge &chg, rsaresponse &h) |
133 | { |
133 | { |
134 | EVP_MD_CTX ctx; |
134 | EVP_MD_CTX ctx; |
135 | |
135 | |
136 | EVP_MD_CTX_init (&ctx); |
136 | EVP_MD_CTX_init (&ctx); |
137 | require (EVP_DigestInit (&ctx, RSA_HASH)); |
137 | require (EVP_DigestInit (&ctx, RSA_HASH)); |
138 | require (EVP_DigestUpdate(&ctx, &chg, sizeof chg)); |
138 | require (EVP_DigestUpdate (&ctx, &chg, sizeof chg)); |
139 | require (EVP_DigestUpdate(&ctx, &id, sizeof id)); |
139 | require (EVP_DigestUpdate (&ctx, &id, sizeof id)); |
140 | require (EVP_DigestFinal (&ctx, (unsigned char *)&h, 0)); |
140 | require (EVP_DigestFinal (&ctx, (unsigned char *)&h, 0)); |
141 | EVP_MD_CTX_cleanup (&ctx); |
141 | EVP_MD_CTX_cleanup (&ctx); |
142 | } |
142 | } |
143 | |
143 | |
144 | struct rsa_entry |
144 | struct rsa_entry |
145 | { |
145 | { |