Branch Coverage

inc/CryptX_PK_DSA.xs.inc
Criterion Covered Total %
branch 95 180 52.7


line true false branch
11 0 72 if (!RETVAL) croak("FATAL: Newz failed");
14 0 72 if (RETVAL->pindex == -1) {
19 0 72 if (rv != CRYPT_OK) {
34 0 1 if (rv != CRYPT_OK) croak("FATAL: dsa_make_key failed: %s", error_to_string(rv));
35 0 1 XPUSHs(ST(0)); /* return self */
45 2 0 data = (unsigned char *)SvPVbyte(dsaparam, data_len);
48 0 2 if (rv != CRYPT_OK) croak("FATAL: dsa_set_pqg_dsaparam failed: %s", error_to_string(rv));
51 0 2 if (rv != CRYPT_OK) croak("FATAL: dsa_generate_key failed: %s", error_to_string(rv));
52 0 2 XPUSHs(ST(0)); /* return self */
62 1 0 if (!p || !strlen(p) || !q || !strlen(q) || !g || !strlen(g)) {
1 0 if (!p || !strlen(p) || !q || !strlen(q) || !g || !strlen(g)) {
1 0 if (!p || !strlen(p) || !q || !strlen(q) || !g || !strlen(g)) {
1 0 if (!p || !strlen(p) || !q || !strlen(q) || !g || !strlen(g)) {
1 0 if (!p || !strlen(p) || !q || !strlen(q) || !g || !strlen(g)) {
0 1 if (!p || !strlen(p) || !q || !strlen(q) || !g || !strlen(g)) {
67 0 1 if (rv != CRYPT_OK) croak("FATAL: radix_to_bin(p) failed: %s", error_to_string(rv));
69 0 1 if (rv != CRYPT_OK) croak("FATAL: radix_to_bin(q) failed: %s", error_to_string(rv));
71 0 1 if (rv != CRYPT_OK) croak("FATAL: radix_to_bin(g) failed: %s", error_to_string(rv));
73 0 1 if (rv != CRYPT_OK) croak("FATAL: dsa_set_pqg failed: %s", error_to_string(rv));
76 0 1 if (rv != CRYPT_OK) croak("FATAL: dsa_generate_key failed: %s", error_to_string(rv));
77 0 1 XPUSHs(ST(0)); /* return self */
88 69 0 data = (unsigned char *)SvPVbyte(key_data, data_len);
89 1 68 if (self->key.type != -1) { dsa_free(&self->key); self->key.type = -1; }
91 0 69 if (rv != CRYPT_OK) croak("FATAL: dsa_import failed: %s", error_to_string(rv));
92 0 69 XPUSHs(ST(0)); /* return self */
103 4 0 if (self->key.type != -1) { dsa_free(&self->key); self->key.type = -1; }
105 4 0 if (p && strlen(p) > 0 && q && strlen(q) > 0 && g && strlen(g) > 0 && y && strlen(y) > 0) {
4 0 if (p && strlen(p) > 0 && q && strlen(q) > 0 && g && strlen(g) > 0 && y && strlen(y) > 0) {
4 0 if (p && strlen(p) > 0 && q && strlen(q) > 0 && g && strlen(g) > 0 && y && strlen(y) > 0) {
4 0 if (p && strlen(p) > 0 && q && strlen(q) > 0 && g && strlen(g) > 0 && y && strlen(y) > 0) {
4 0 if (p && strlen(p) > 0 && q && strlen(q) > 0 && g && strlen(g) > 0 && y && strlen(y) > 0) {
4 0 if (p && strlen(p) > 0 && q && strlen(q) > 0 && g && strlen(g) > 0 && y && strlen(y) > 0) {
4 0 if (p && strlen(p) > 0 && q && strlen(q) > 0 && g && strlen(g) > 0 && y && strlen(y) > 0) {
4 0 if (p && strlen(p) > 0 && q && strlen(q) > 0 && g && strlen(g) > 0 && y && strlen(y) > 0) {
107 0 4 if (rv != CRYPT_OK) croak("FATAL: radix_to_bin(p) failed: %s", error_to_string(rv));
109 0 4 if (rv != CRYPT_OK) croak("FATAL: radix_to_bin(q) failed: %s", error_to_string(rv));
111 0 4 if (rv != CRYPT_OK) croak("FATAL: radix_to_bin(g) failed: %s", error_to_string(rv));
113 0 4 if (rv != CRYPT_OK) croak("FATAL: dsa_set_pqg failed: %s", error_to_string(rv));
116 0 4 if (rv != CRYPT_OK) croak("FATAL: radix_to_bin(y) failed: %s", error_to_string(rv));
117 2 2 if (x && strlen(x) > 0) {
1 1 if (x && strlen(x) > 0) {
120 0 1 if (rv != CRYPT_OK) croak("FATAL: radix_to_bin(x) failed: %s", error_to_string(rv));
122 0 1 if (rv != CRYPT_OK) croak("FATAL: dsa_set_key failed: %s", error_to_string(rv));
127 0 3 if (rv != CRYPT_OK) croak("FATAL: dsa_set_key failed: %s", error_to_string(rv));
131 0 4 XPUSHs(ST(0)); /* return self */
137 32 0 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
0 32 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
145 1 0 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
0 1 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
153 0 0 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
0 0 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
166 45 0 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
0 45 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
171 45 0 siz = (self->key.g) ? mp_unsigned_bin_size(self->key.g) : 0;
172 0 45 if (siz>10000) {
175 45 0 if (siz>0) {
183 45 0 siz = (self->key.q) ? mp_unsigned_bin_size(self->key.q) : 0;
184 0 45 if (siz>10000) {
187 45 0 if (siz>0) {
195 45 0 siz = (self->key.p) ? mp_unsigned_bin_size(self->key.p) : 0;
196 0 45 if (siz>10000) {
199 45 0 if (siz>0) {
207 45 0 siz = (self->key.x) ? mp_unsigned_bin_size(self->key.x) : 0;
208 0 45 if (siz>10000) {
211 22 23 if (siz>0) {
219 45 0 siz = (self->key.y) ? mp_unsigned_bin_size(self->key.y) : 0;
220 0 45 if (siz>10000) {
223 45 0 if (siz>0) {
248 8 8 if (strnEQ(type, "private", 7)) {
250 0 8 if (rv != CRYPT_OK) croak("FATAL: dsa_export(PK_PRIVATE|PK_STD) failed: %s", error_to_string(rv));
253 8 0 else if (strnEQ(type, "public", 6)) {
255 0 8 if (rv != CRYPT_OK) croak("FATAL: dsa_export(PK_PUBLIC|PK_STD) failed: %s", error_to_string(rv));
275 2 0 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
278 0 2 if (hash_id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
282 0 2 if (rv != CRYPT_OK) croak("FATAL: dsa_encrypt_key failed: %s", error_to_string(rv));
298 2 0 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
301 0 2 if (rv != CRYPT_OK) croak("FATAL: dsa_decrypt_key_ex failed: %s", error_to_string(rv));
318 4 0 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
319 2 2 if (ix == 1) {
321 0 2 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
323 0 2 if (rv != CRYPT_OK) croak("FATAL: hash_memory failed: %s", error_to_string(rv));
330 0 4 if (rv != CRYPT_OK) croak("FATAL: dsa_sign_hash_ex failed: %s", error_to_string(rv));
347 40 0 data_ptr = (unsigned char *)SvPVbyte(data, data_len);
348 40 0 sig_ptr = (unsigned char *)SvPVbyte(sig, sig_len);
349 38 2 if (ix == 1) {
351 0 38 if (id == -1) croak("FATAL: find_hash failed for '%s'", hash_name);
353 0 38 if (rv != CRYPT_OK) croak("FATAL: hash_memory failed: %s", error_to_string(rv));
360 40 0 if (rv != CRYPT_OK || stat != 1) RETVAL = 0;
0 40 if (rv != CRYPT_OK || stat != 1) RETVAL = 0;
368 72 0 if (self->key.type != -1) { dsa_free(&self->key); self->key.type = -1; }