ssh-dss.c (204917) | ssh-dss.c (215116) |
---|---|
1/* $OpenBSD: ssh-dss.c,v 1.25 2010/02/26 20:29:54 djm Exp $ */ | 1/* $OpenBSD: ssh-dss.c,v 1.26 2010/04/16 01:47:26 djm Exp $ */ |
2/* 3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. --- 38 unchanged lines hidden (view full) --- 48{ 49 DSA_SIG *sig; 50 const EVP_MD *evp_md = EVP_sha1(); 51 EVP_MD_CTX md; 52 u_char digest[EVP_MAX_MD_SIZE], sigblob[SIGBLOB_LEN]; 53 u_int rlen, slen, len, dlen; 54 Buffer b; 55 | 2/* 3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. --- 38 unchanged lines hidden (view full) --- 48{ 49 DSA_SIG *sig; 50 const EVP_MD *evp_md = EVP_sha1(); 51 EVP_MD_CTX md; 52 u_char digest[EVP_MAX_MD_SIZE], sigblob[SIGBLOB_LEN]; 53 u_int rlen, slen, len, dlen; 54 Buffer b; 55 |
56 if (key == NULL || 57 (key->type != KEY_DSA && key->type != KEY_DSA_CERT) || 58 key->dsa == NULL) { | 56 if (key == NULL || key->dsa == NULL || (key->type != KEY_DSA && 57 key->type != KEY_DSA_CERT && key->type != KEY_DSA_CERT_V00)) { |
59 error("ssh_dss_sign: no DSA key"); 60 return -1; 61 } 62 EVP_DigestInit(&md, evp_md); 63 EVP_DigestUpdate(&md, data, datalen); 64 EVP_DigestFinal(&md, digest, &dlen); 65 66 sig = DSA_do_sign(digest, dlen, key->dsa); --- 46 unchanged lines hidden (view full) --- 113 DSA_SIG *sig; 114 const EVP_MD *evp_md = EVP_sha1(); 115 EVP_MD_CTX md; 116 u_char digest[EVP_MAX_MD_SIZE], *sigblob; 117 u_int len, dlen; 118 int rlen, ret; 119 Buffer b; 120 | 58 error("ssh_dss_sign: no DSA key"); 59 return -1; 60 } 61 EVP_DigestInit(&md, evp_md); 62 EVP_DigestUpdate(&md, data, datalen); 63 EVP_DigestFinal(&md, digest, &dlen); 64 65 sig = DSA_do_sign(digest, dlen, key->dsa); --- 46 unchanged lines hidden (view full) --- 112 DSA_SIG *sig; 113 const EVP_MD *evp_md = EVP_sha1(); 114 EVP_MD_CTX md; 115 u_char digest[EVP_MAX_MD_SIZE], *sigblob; 116 u_int len, dlen; 117 int rlen, ret; 118 Buffer b; 119 |
121 if (key == NULL || 122 (key->type != KEY_DSA && key->type != KEY_DSA_CERT) || 123 key->dsa == NULL) { | 120 if (key == NULL || key->dsa == NULL || (key->type != KEY_DSA && 121 key->type != KEY_DSA_CERT && key->type != KEY_DSA_CERT_V00)) { |
124 error("ssh_dss_verify: no DSA key"); 125 return -1; 126 } 127 128 /* fetch signature */ 129 if (datafellows & SSH_BUG_SIGBLOB) { 130 sigblob = xmalloc(signaturelen); 131 memcpy(sigblob, signature, signaturelen); --- 58 unchanged lines hidden --- | 122 error("ssh_dss_verify: no DSA key"); 123 return -1; 124 } 125 126 /* fetch signature */ 127 if (datafellows & SSH_BUG_SIGBLOB) { 128 sigblob = xmalloc(signaturelen); 129 memcpy(sigblob, signature, signaturelen); --- 58 unchanged lines hidden --- |