| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/asn1/p5_pbev2.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | static const ASN1_TEMPLATE PBE2PARAM_seq_tt[] = { | - | ||||||||||||
| 6 | { | - | ||||||||||||
| 7 | .offset = | - | ||||||||||||
| 8 | __builtin_offsetof ( | - | ||||||||||||
| 9 | PBE2PARAM | - | ||||||||||||
| 10 | , | - | ||||||||||||
| 11 | keyfunc | - | ||||||||||||
| 12 | ) | - | ||||||||||||
| 13 | , | - | ||||||||||||
| 14 | .field_name = "keyfunc", | - | ||||||||||||
| 15 | .item = &X509_ALGOR_it, | - | ||||||||||||
| 16 | }, | - | ||||||||||||
| 17 | { | - | ||||||||||||
| 18 | .offset = | - | ||||||||||||
| 19 | __builtin_offsetof ( | - | ||||||||||||
| 20 | PBE2PARAM | - | ||||||||||||
| 21 | , | - | ||||||||||||
| 22 | encryption | - | ||||||||||||
| 23 | ) | - | ||||||||||||
| 24 | , | - | ||||||||||||
| 25 | .field_name = "encryption", | - | ||||||||||||
| 26 | .item = &X509_ALGOR_it, | - | ||||||||||||
| 27 | }, | - | ||||||||||||
| 28 | }; | - | ||||||||||||
| 29 | - | |||||||||||||
| 30 | const ASN1_ITEM PBE2PARAM_it = { | - | ||||||||||||
| 31 | .itype = 0x1, | - | ||||||||||||
| 32 | .utype = 16, | - | ||||||||||||
| 33 | .templates = PBE2PARAM_seq_tt, | - | ||||||||||||
| 34 | .tcount = sizeof(PBE2PARAM_seq_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||||||||
| 35 | .size = sizeof(PBE2PARAM), | - | ||||||||||||
| 36 | .sname = "PBE2PARAM", | - | ||||||||||||
| 37 | }; | - | ||||||||||||
| 38 | - | |||||||||||||
| 39 | - | |||||||||||||
| 40 | PBE2PARAM * | - | ||||||||||||
| 41 | d2i_PBE2PARAM(PBE2PARAM **a, const unsigned char **in, long len) | - | ||||||||||||
| 42 | { | - | ||||||||||||
| 43 | return never executed: (PBE2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,return (PBE2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &PBE2PARAM_it);never executed: return (PBE2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &PBE2PARAM_it); | 0 | ||||||||||||
| 44 | &PBE2PARAM_it); never executed: return (PBE2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &PBE2PARAM_it); | 0 | ||||||||||||
| 45 | } | - | ||||||||||||
| 46 | - | |||||||||||||
| 47 | int | - | ||||||||||||
| 48 | i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **out) | - | ||||||||||||
| 49 | { | - | ||||||||||||
| 50 | return never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, &PBE2PARAM_it);return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBE2PARAM_it);never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBE2PARAM_it); | 0 | ||||||||||||
| 51 | } | - | ||||||||||||
| 52 | - | |||||||||||||
| 53 | PBE2PARAM * | - | ||||||||||||
| 54 | PBE2PARAM_new(void) | - | ||||||||||||
| 55 | { | - | ||||||||||||
| 56 | return never executed: (PBE2PARAM *)ASN1_item_new(&PBE2PARAM_it);return (PBE2PARAM *)ASN1_item_new(&PBE2PARAM_it);never executed: return (PBE2PARAM *)ASN1_item_new(&PBE2PARAM_it); | 0 | ||||||||||||
| 57 | } | - | ||||||||||||
| 58 | - | |||||||||||||
| 59 | void | - | ||||||||||||
| 60 | PBE2PARAM_free(PBE2PARAM *a) | - | ||||||||||||
| 61 | { | - | ||||||||||||
| 62 | ASN1_item_free((ASN1_VALUE *)a, &PBE2PARAM_it); | - | ||||||||||||
| 63 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||
| 64 | - | |||||||||||||
| 65 | static const ASN1_TEMPLATE PBKDF2PARAM_seq_tt[] = { | - | ||||||||||||
| 66 | { | - | ||||||||||||
| 67 | .offset = | - | ||||||||||||
| 68 | __builtin_offsetof ( | - | ||||||||||||
| 69 | PBKDF2PARAM | - | ||||||||||||
| 70 | , | - | ||||||||||||
| 71 | salt | - | ||||||||||||
| 72 | ) | - | ||||||||||||
| 73 | , | - | ||||||||||||
| 74 | .field_name = "salt", | - | ||||||||||||
| 75 | .item = &ASN1_ANY_it, | - | ||||||||||||
| 76 | }, | - | ||||||||||||
| 77 | { | - | ||||||||||||
| 78 | .offset = | - | ||||||||||||
| 79 | __builtin_offsetof ( | - | ||||||||||||
| 80 | PBKDF2PARAM | - | ||||||||||||
| 81 | , | - | ||||||||||||
| 82 | iter | - | ||||||||||||
| 83 | ) | - | ||||||||||||
| 84 | , | - | ||||||||||||
| 85 | .field_name = "iter", | - | ||||||||||||
| 86 | .item = &ASN1_INTEGER_it, | - | ||||||||||||
| 87 | }, | - | ||||||||||||
| 88 | { | - | ||||||||||||
| 89 | .flags = (0x1), | - | ||||||||||||
| 90 | .offset = | - | ||||||||||||
| 91 | __builtin_offsetof ( | - | ||||||||||||
| 92 | PBKDF2PARAM | - | ||||||||||||
| 93 | , | - | ||||||||||||
| 94 | keylength | - | ||||||||||||
| 95 | ) | - | ||||||||||||
| 96 | , | - | ||||||||||||
| 97 | .field_name = "keylength", | - | ||||||||||||
| 98 | .item = &ASN1_INTEGER_it, | - | ||||||||||||
| 99 | }, | - | ||||||||||||
| 100 | { | - | ||||||||||||
| 101 | .flags = (0x1), | - | ||||||||||||
| 102 | .offset = | - | ||||||||||||
| 103 | __builtin_offsetof ( | - | ||||||||||||
| 104 | PBKDF2PARAM | - | ||||||||||||
| 105 | , | - | ||||||||||||
| 106 | prf | - | ||||||||||||
| 107 | ) | - | ||||||||||||
| 108 | , | - | ||||||||||||
| 109 | .field_name = "prf", | - | ||||||||||||
| 110 | .item = &X509_ALGOR_it, | - | ||||||||||||
| 111 | }, | - | ||||||||||||
| 112 | }; | - | ||||||||||||
| 113 | - | |||||||||||||
| 114 | const ASN1_ITEM PBKDF2PARAM_it = { | - | ||||||||||||
| 115 | .itype = 0x1, | - | ||||||||||||
| 116 | .utype = 16, | - | ||||||||||||
| 117 | .templates = PBKDF2PARAM_seq_tt, | - | ||||||||||||
| 118 | .tcount = sizeof(PBKDF2PARAM_seq_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||||||||
| 119 | .size = sizeof(PBKDF2PARAM), | - | ||||||||||||
| 120 | .sname = "PBKDF2PARAM", | - | ||||||||||||
| 121 | }; | - | ||||||||||||
| 122 | - | |||||||||||||
| 123 | - | |||||||||||||
| 124 | PBKDF2PARAM * | - | ||||||||||||
| 125 | d2i_PBKDF2PARAM(PBKDF2PARAM **a, const unsigned char **in, long len) | - | ||||||||||||
| 126 | { | - | ||||||||||||
| 127 | return never executed: (PBKDF2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,return (PBKDF2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &PBKDF2PARAM_it);never executed: return (PBKDF2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &PBKDF2PARAM_it); | 0 | ||||||||||||
| 128 | &PBKDF2PARAM_it); never executed: return (PBKDF2PARAM *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &PBKDF2PARAM_it); | 0 | ||||||||||||
| 129 | } | - | ||||||||||||
| 130 | - | |||||||||||||
| 131 | int | - | ||||||||||||
| 132 | i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **out) | - | ||||||||||||
| 133 | { | - | ||||||||||||
| 134 | return never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, &PBKDF2PARAM_it);return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBKDF2PARAM_it);never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBKDF2PARAM_it); | 0 | ||||||||||||
| 135 | } | - | ||||||||||||
| 136 | - | |||||||||||||
| 137 | PBKDF2PARAM * | - | ||||||||||||
| 138 | PBKDF2PARAM_new(void) | - | ||||||||||||
| 139 | { | - | ||||||||||||
| 140 | return never executed: (PBKDF2PARAM *)ASN1_item_new(&PBKDF2PARAM_it);return (PBKDF2PARAM *)ASN1_item_new(&PBKDF2PARAM_it);never executed: return (PBKDF2PARAM *)ASN1_item_new(&PBKDF2PARAM_it); | 0 | ||||||||||||
| 141 | } | - | ||||||||||||
| 142 | - | |||||||||||||
| 143 | void | - | ||||||||||||
| 144 | PBKDF2PARAM_free(PBKDF2PARAM *a) | - | ||||||||||||
| 145 | { | - | ||||||||||||
| 146 | ASN1_item_free((ASN1_VALUE *)a, &PBKDF2PARAM_it); | - | ||||||||||||
| 147 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||
| 148 | - | |||||||||||||
| 149 | - | |||||||||||||
| 150 | - | |||||||||||||
| 151 | - | |||||||||||||
| 152 | - | |||||||||||||
| 153 | - | |||||||||||||
| 154 | - | |||||||||||||
| 155 | X509_ALGOR * | - | ||||||||||||
| 156 | PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, unsigned char *salt, | - | ||||||||||||
| 157 | int saltlen, unsigned char *aiv, int prf_nid) | - | ||||||||||||
| 158 | { | - | ||||||||||||
| 159 | X509_ALGOR *scheme = | - | ||||||||||||
| 160 | ((void *)0) | - | ||||||||||||
| 161 | , *kalg = | - | ||||||||||||
| 162 | ((void *)0) | - | ||||||||||||
| 163 | , *ret = | - | ||||||||||||
| 164 | ((void *)0) | - | ||||||||||||
| 165 | ; | - | ||||||||||||
| 166 | int alg_nid, keylen; | - | ||||||||||||
| 167 | EVP_CIPHER_CTX ctx; | - | ||||||||||||
| 168 | unsigned char iv[16]; | - | ||||||||||||
| 169 | PBE2PARAM *pbe2 = | - | ||||||||||||
| 170 | ((void *)0) | - | ||||||||||||
| 171 | ; | - | ||||||||||||
| 172 | ASN1_OBJECT *obj; | - | ||||||||||||
| 173 | - | |||||||||||||
| 174 | alg_nid = EVP_CIPHER_type(cipher); | - | ||||||||||||
| 175 | if (alg_nid == 0
| 0 | ||||||||||||
| 176 | ERR_put_error(13,(0xfff),(108),__FILE__,196); | - | ||||||||||||
| 177 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 178 | } | - | ||||||||||||
| 179 | obj = OBJ_nid2obj(alg_nid); | - | ||||||||||||
| 180 | - | |||||||||||||
| 181 | if (!(pbe2 = PBE2PARAM_new())
| 0 | ||||||||||||
| 182 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 183 | - | |||||||||||||
| 184 | - | |||||||||||||
| 185 | scheme = pbe2->encryption; | - | ||||||||||||
| 186 | - | |||||||||||||
| 187 | scheme->algorithm = obj; | - | ||||||||||||
| 188 | if (!(scheme->parameter = ASN1_TYPE_new())
| 0 | ||||||||||||
| 189 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 190 | - | |||||||||||||
| 191 | - | |||||||||||||
| 192 | if (EVP_CIPHER_iv_length(cipher)
| 0 | ||||||||||||
| 193 | if (aiv
| 0 | ||||||||||||
| 194 | memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher)); never executed: memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher)); | 0 | ||||||||||||
| 195 | else | - | ||||||||||||
| 196 | arc4random_buf(iv, EVP_CIPHER_iv_length(cipher)); never executed: arc4random_buf(iv, EVP_CIPHER_iv_length(cipher)); | 0 | ||||||||||||
| 197 | } | - | ||||||||||||
| 198 | - | |||||||||||||
| 199 | EVP_CIPHER_CTX_init(&ctx); | - | ||||||||||||
| 200 | - | |||||||||||||
| 201 | - | |||||||||||||
| 202 | if (!EVP_CipherInit_ex(&ctx, cipher,
| 0 | ||||||||||||
| 203 | ((void *)0)
| 0 | ||||||||||||
| 204 | ,
| 0 | ||||||||||||
| 205 | ((void *)0)
| 0 | ||||||||||||
| 206 | , iv, 0)
| 0 | ||||||||||||
| 207 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 208 | if (EVP_CIPHER_param_to_asn1(&ctx, scheme->parameter) < 0
| 0 | ||||||||||||
| 209 | ERR_put_error(13,(0xfff),(114),__FILE__,225); | - | ||||||||||||
| 210 | EVP_CIPHER_CTX_cleanup(&ctx); | - | ||||||||||||
| 211 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 212 | } | - | ||||||||||||
| 213 | - | |||||||||||||
| 214 | - | |||||||||||||
| 215 | - | |||||||||||||
| 216 | if ((
| 0 | ||||||||||||
| 217 | EVP_CIPHER_CTX_ctrl(&ctx, 0x7, 0, &prf_nid) <= 0
| 0 | ||||||||||||
| 218 | ERR_clear_error(); | - | ||||||||||||
| 219 | prf_nid = 163; | - | ||||||||||||
| 220 | } never executed: end of block | 0 | ||||||||||||
| 221 | EVP_CIPHER_CTX_cleanup(&ctx); | - | ||||||||||||
| 222 | - | |||||||||||||
| 223 | - | |||||||||||||
| 224 | - | |||||||||||||
| 225 | if (alg_nid == 37
| 0 | ||||||||||||
| 226 | keylen = EVP_CIPHER_key_length(cipher); never executed: keylen = EVP_CIPHER_key_length(cipher); | 0 | ||||||||||||
| 227 | else | - | ||||||||||||
| 228 | keylen = -1; never executed: keylen = -1; | 0 | ||||||||||||
| 229 | - | |||||||||||||
| 230 | - | |||||||||||||
| 231 | - | |||||||||||||
| 232 | X509_ALGOR_free(pbe2->keyfunc); | - | ||||||||||||
| 233 | - | |||||||||||||
| 234 | pbe2->keyfunc = PKCS5_pbkdf2_set(iter, salt, saltlen, prf_nid, keylen); | - | ||||||||||||
| 235 | - | |||||||||||||
| 236 | if (!pbe2->keyfunc
| 0 | ||||||||||||
| 237 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 238 | - | |||||||||||||
| 239 | - | |||||||||||||
| 240 | - | |||||||||||||
| 241 | if (!(ret = X509_ALGOR_new())
| 0 | ||||||||||||
| 242 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 243 | if (!(ret->parameter = ASN1_TYPE_new())
| 0 | ||||||||||||
| 244 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 245 | - | |||||||||||||
| 246 | ret->algorithm = OBJ_nid2obj(161); | - | ||||||||||||
| 247 | - | |||||||||||||
| 248 | - | |||||||||||||
| 249 | - | |||||||||||||
| 250 | if (!ASN1_item_pack(pbe2, &PBE2PARAM_it,
| 0 | ||||||||||||
| 251 | &ret->parameter->value.sequence)
never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 252 | ret->parameter->type = 16; | - | ||||||||||||
| 253 | - | |||||||||||||
| 254 | PBE2PARAM_free(pbe2); | - | ||||||||||||
| 255 | pbe2 = | - | ||||||||||||
| 256 | ((void *)0) | - | ||||||||||||
| 257 | ; | - | ||||||||||||
| 258 | - | |||||||||||||
| 259 | return never executed: ret;return ret;never executed: return ret; | 0 | ||||||||||||
| 260 | - | |||||||||||||
| 261 | merr: | - | ||||||||||||
| 262 | ERR_put_error(13,(0xfff),((1|64)),__FILE__,276); | - | ||||||||||||
| 263 | - | |||||||||||||
| 264 | err: code before this statement never executed: err: | 0 | ||||||||||||
| 265 | PBE2PARAM_free(pbe2); | - | ||||||||||||
| 266 | - | |||||||||||||
| 267 | X509_ALGOR_free(kalg); | - | ||||||||||||
| 268 | X509_ALGOR_free(ret); | - | ||||||||||||
| 269 | - | |||||||||||||
| 270 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||
| 271 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||
| 272 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||
| 273 | } | - | ||||||||||||
| 274 | - | |||||||||||||
| 275 | X509_ALGOR * | - | ||||||||||||
| 276 | PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, unsigned char *salt, | - | ||||||||||||
| 277 | int saltlen) | - | ||||||||||||
| 278 | { | - | ||||||||||||
| 279 | return never executed: PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, ((void *)0) , -1);never executed: return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, ((void *)0) , -1); | 0 | ||||||||||||
| 280 | ((void *)0) never executed: return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, ((void *)0) , -1); | 0 | ||||||||||||
| 281 | , -1); never executed: return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, ((void *)0) , -1); | 0 | ||||||||||||
| 282 | } | - | ||||||||||||
| 283 | - | |||||||||||||
| 284 | X509_ALGOR * | - | ||||||||||||
| 285 | PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, int prf_nid, | - | ||||||||||||
| 286 | int keylen) | - | ||||||||||||
| 287 | { | - | ||||||||||||
| 288 | X509_ALGOR *keyfunc = | - | ||||||||||||
| 289 | ((void *)0) | - | ||||||||||||
| 290 | ; | - | ||||||||||||
| 291 | PBKDF2PARAM *kdf = | - | ||||||||||||
| 292 | ((void *)0) | - | ||||||||||||
| 293 | ; | - | ||||||||||||
| 294 | ASN1_OCTET_STRING *osalt = | - | ||||||||||||
| 295 | ((void *)0) | - | ||||||||||||
| 296 | ; | - | ||||||||||||
| 297 | - | |||||||||||||
| 298 | if (!(kdf = PBKDF2PARAM_new())
| 0 | ||||||||||||
| 299 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 300 | if (!(osalt = ASN1_OCTET_STRING_new())
| 0 | ||||||||||||
| 301 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 302 | - | |||||||||||||
| 303 | kdf->salt->value.octet_string = osalt; | - | ||||||||||||
| 304 | kdf->salt->type = 4; | - | ||||||||||||
| 305 | - | |||||||||||||
| 306 | if (!saltlen
| 0 | ||||||||||||
| 307 | saltlen = 8; never executed: saltlen = 8; | 0 | ||||||||||||
| 308 | if (!(osalt->data = malloc (saltlen))
| 0 | ||||||||||||
| 309 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 310 | - | |||||||||||||
| 311 | osalt->length = saltlen; | - | ||||||||||||
| 312 | - | |||||||||||||
| 313 | if (salt
| 0 | ||||||||||||
| 314 | memcpy (osalt->data, salt, saltlen); never executed: memcpy (osalt->data, salt, saltlen); | 0 | ||||||||||||
| 315 | else | - | ||||||||||||
| 316 | arc4random_buf(osalt->data, saltlen); never executed: arc4random_buf(osalt->data, saltlen); | 0 | ||||||||||||
| 317 | - | |||||||||||||
| 318 | if (iter <= 0
| 0 | ||||||||||||
| 319 | iter = 2048; never executed: iter = 2048; | 0 | ||||||||||||
| 320 | - | |||||||||||||
| 321 | if (!ASN1_INTEGER_set(kdf->iter, iter)
| 0 | ||||||||||||
| 322 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 323 | - | |||||||||||||
| 324 | - | |||||||||||||
| 325 | - | |||||||||||||
| 326 | if (keylen > 0
| 0 | ||||||||||||
| 327 | if (!(kdf->keylength = ASN1_INTEGER_new())
| 0 | ||||||||||||
| 328 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 329 | if (!ASN1_INTEGER_set(kdf->keylength, keylen)
| 0 | ||||||||||||
| 330 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 331 | } never executed: end of block | 0 | ||||||||||||
| 332 | - | |||||||||||||
| 333 | - | |||||||||||||
| 334 | if (prf_nid > 0
| 0 | ||||||||||||
| 335 | kdf->prf = X509_ALGOR_new(); | - | ||||||||||||
| 336 | if (!kdf->prf
| 0 | ||||||||||||
| 337 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 338 | X509_ALGOR_set0(kdf->prf, OBJ_nid2obj(prf_nid), | - | ||||||||||||
| 339 | 5, | - | ||||||||||||
| 340 | ((void *)0) | - | ||||||||||||
| 341 | ); | - | ||||||||||||
| 342 | } never executed: end of block | 0 | ||||||||||||
| 343 | - | |||||||||||||
| 344 | - | |||||||||||||
| 345 | - | |||||||||||||
| 346 | keyfunc = X509_ALGOR_new(); | - | ||||||||||||
| 347 | if (!keyfunc
| 0 | ||||||||||||
| 348 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 349 | - | |||||||||||||
| 350 | keyfunc->algorithm = OBJ_nid2obj(69); | - | ||||||||||||
| 351 | - | |||||||||||||
| 352 | - | |||||||||||||
| 353 | - | |||||||||||||
| 354 | if (!(keyfunc->parameter = ASN1_TYPE_new())
| 0 | ||||||||||||
| 355 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 356 | - | |||||||||||||
| 357 | if (!ASN1_item_pack(kdf, &PBKDF2PARAM_it,
| 0 | ||||||||||||
| 358 | &keyfunc->parameter->value.sequence)
| 0 | ||||||||||||
| 359 | goto never executed: merr;goto merr;never executed: goto merr; | 0 | ||||||||||||
| 360 | keyfunc->parameter->type = 16; | - | ||||||||||||
| 361 | - | |||||||||||||
| 362 | PBKDF2PARAM_free(kdf); | - | ||||||||||||
| 363 | return never executed: keyfunc;return keyfunc;never executed: return keyfunc; | 0 | ||||||||||||
| 364 | - | |||||||||||||
| 365 | merr: | - | ||||||||||||
| 366 | ERR_put_error(13,(0xfff),((1|64)),__FILE__,368); | - | ||||||||||||
| 367 | PBKDF2PARAM_free(kdf); | - | ||||||||||||
| 368 | X509_ALGOR_free(keyfunc); | - | ||||||||||||
| 369 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||
| 370 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||
| 371 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||
| 372 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |