cert.c revision 4de84af23db74e13e867985c9093f394c9fa8d51
/*
SSSD - certificate handling utils - openssl version
Copyright (C) Sumit Bose <sbose@redhat.com> 2015
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
{
const unsigned char *d;
int ret;
long p_size;
char *p;
return EINVAL;
}
d = (const unsigned char *) der_blob;
return EINVAL;
}
goto done;
}
if (ret != 1) {
goto done;
}
if (p_size == 0) {
goto done;
}
goto done;
}
}
}
done:
return ret;
}
{
int ret;
unsigned char *buf;
int buf_size;
return EINVAL;
}
goto done;
}
if (ret <= 0) {
goto done;
}
goto done;
}
if (buf_size <= 0) {
goto done;
}
goto done;
}
"i2d_X509 size mismatch between two calls.\n");
goto done;
}
}
}
done:
return ret;
}
#define SSH_RSA_HEADER "ssh-rsa"
{
int ret;
const unsigned char *d;
size_t c;
int modulus_len;
int exponent_len;
return EINVAL;
}
d = (const unsigned char *) der_blob;
return EINVAL;
}
/* TODO: verify certificate !!!!! */
if (cert_pub_key == NULL) {
goto done;
}
"Expected RSA public key, found unsupported [%d].\n",
cert_pub_key->type);
goto done;
}
+ 1; /* see comment about missing 00 below */
goto done;
}
c = 0;
/* Adding missing 00 which afaik is added to make sure
* the bigint is handled as positive number */
/* TODO: make a better check if 00 must be added or not, e.g. ... & 0x80)
*/
done:
}
return ret;
}